I am learning reactjs and making a quiz app. I want to execute a piece of code in parent component using useEffect. the dependency of this useEffect function is based on a state