Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

disable first render react

Refer
https://stackoverflow.com/a/71342621/15187131

// Or use useLayoutEffect
const firstUpdate = useRef(true);
  useLayoutEffect(() => {
    if (firstUpdate.current) {
      firstUpdate.current = false;
    } else {
     // do things after first render
  }
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #disable #render #react
ADD COMMENT
Topic
Name
1+6 =