Answers for "did mount update shoud run only after some changes in perticular function"

0

useeffect on update

const isInitialMount = useRef(true);

useEffect(() => {
  if (isInitialMount.current) {
     isInitialMount.current = false;
  } else {
      // Your useEffect code here to be run on update
  }
});
Posted by: Guest on August-30-2020

Code answers related to "did mount update shoud run only after some changes in perticular function"

Code answers related to "Javascript"

Browse Popular Code Answers by Language