showing results for - "useeffect on update"
Marlene
29 Nov 2017
1const isInitialMount = useRef(true);
2
3useEffect(() => {
4  if (isInitialMount.current) {
5     isInitialMount.current = false;
6  } else {
7      // Your useEffect code here to be run on update
8  }
9});