You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
doSomething((myElement,[myState,setMyState])=>{constmouseOverHandler=e=>{setMyState(/* some always changing value */)}myElement.addEventListener('mouseover',mouseOverHandler)return()=>{myElement.removeEventListener('mouseover',mouseOverHandler)}},[myElement,myState])
is constantly being re-called, even though it does not have to be. Requiring the state in the statesAndRefs array (to use the setState function) does not imply the usage of the state's value.
Providing the option to use a setState without listening to state changes will drastically improve performance.
The text was updated successfully, but these errors were encountered:
A state listener like this
is constantly being re-called, even though it does not have to be. Requiring the state in the
statesAndRefs
array (to use thesetState
function) does not imply the usage of the state's value.Providing the option to use a
setState
without listening to state changes will drastically improve performance.The text was updated successfully, but these errors were encountered: