Reactjs – Is it appropriate to use `useEffect` to fetch new state when a prop changes?
Is it appropriate to use useEffect to fetch new state when a prop changes? For example, like this: const Parent = () => { const [parentVal, setParentVal] = useState(0); const updateParentVal = () => { setParentVal((v) => v + 1);…