Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR HTML

when does useeffect return run

------------------------------------------------------------------------
The useEffect returned function runs according to the dependencies array:
------------------------------------------------------------------------
- if it's empty [], on unmount.
- if it has dependencies [value1,value2], on dependencies 
  change (shallow comparison) and unmount.
- if it has no dependencies (no 2nd argument for useEffect) 
  it runs on every render and unmount.
------------------------------------------------------------------------
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #useeffect #return #run
ADD COMMENT
Topic
Name
5+1 =