Answers for "componentdidupdate in hooks"

1

componentdidupdate in hooks

const App = props => {
  const didMountRef = useRef(false)
  useEffect(() => {
    if (didMountRef.current) {
      doStuff()
    } else didMountRef.current = true
  }
}
Posted by: Guest on November-02-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language