Allows to run side effects after rendering
Where :
effectCallback
: Function that is executed one or more times according to optionalArgumentList
,effectCallback
can return a function that will be executed only if effectCallback
is executed again or the webcomponent is unmounted.
optionalArgumentList
: Array of arguments that controls the execution of effectCallback
, if an argument ofoptionalArgumentList
changes it will trigger that effectCallback
is executed again without first cleaning the effects subscribed by the previous execution.
useLayoutEffect replicates the logic of useEffect but with synchronous execution after rendering.
useLayoutEffect replicates the logic of useEffect but with synchronous execution before rendering.