Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

useLayoutEffect

useLayoutEffect works exactly the same as useEffect
useLayoutEffect runs synchronously while useEffect runs asynchronously
useLayoutEffect runs after the code mutation
useLayoutEffect make changes before the browser paints the DOM

Just remember useLayoutEffect is identical to useEffect but runs synchronously !!
 
PREVIOUS NEXT
Tagged: #useLayoutEffect
ADD COMMENT
Topic
Name
7+3 =