Answers for "replicate component did update hooks"

0

replicate component did update hooks

const mounted = useRef();
useEffect(() => {
  if (!mounted.current) {
    // do componentDidMount logic
    mounted.current = true;
  } else {
    // do componentDidUpdate logic
  }
});
Posted by: Guest on June-10-2021

Code answers related to "replicate component did update hooks"

Browse Popular Code Answers by Language