The reason I am not using setPerson is because it has be wrapped under useEffect hook but I want to pass this person data to another useState Variables.
Since useState happens in initial load, if we use useEffect I wont be able to pass data to useState variables
The reason I am not using setPerson is because it has be wrapped under useEffect hook but I want to pass this person data to another useState Variables.
Since useState happens in initial load, if we use useEffect I wont be able to pass data to useState variables
You still need setPerson. Basically with a functional component using hooks, setState is not defined. Hence your type error.