Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

componentdidupdate in hooks

const App = props => {
  const didMountRef = useRef(false)
  useEffect(() => {
    if (didMountRef.current) {
      doStuff()
    } else didMountRef.current = true
  }
}
Source by dev.to #
 
PREVIOUS NEXT
Tagged: #componentdidupdate #hooks
ADD COMMENT
Topic
Name
8+6 =