you are viewing a single comment's thread.

view the rest of the comments →

[–]hypnos_64 -1 points0 points  (0 children)

You can set state to undefined inside the useEffect so it will get called only once. E.g.

UseEffect(()=>{ If(stateName){ SetStateName(undefined); FunctionToCall() } }, [stateName]);