Here is my code, that I\'ve been converting from a react class, to a functional one (I\'ve had to remove some bits, and rename a lot of stuff):
const determin