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
Another bad example, react-use's useUpdateEffect will be called at the same time of useEffect when HRM.
importReact,{useState}from'react';import{useUpdateEffect}from'react-use';exportdefault()=>{useEffect(()=>{console.log('mount')},[]);useUpdateEffect(()=>{console.log('updateEffect')},[]);return(<div>
hello world
</div>)}
The text was updated successfully, but these errors were encountered:
brickspert
changed the title
Empty deps useEffect be called on re-render in HMR will cause problems
useEffect be called on re-render in HMR will cause problems
May 8, 2021
Without HRM, the count Maximum will be 1.
But with HRM, the count increases with updates.
Is this the expected behavior?
Another bad example, react-use's useUpdateEffect will be called at the same time of useEffect when HRM.
The text was updated successfully, but these errors were encountered: