Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

change parent state from child use effect in react js

// wrap the callback with React.useCallback
const handleChange = useCallback(() => {
  setState(state + 1);
},[]);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #change #parent #state #child #effect #react #js
ADD COMMENT
Topic
Name
9+5 =