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
I think the intended behavior is that it should change whenever the props actually change, but this useMemo will create a new effect instance on every render.
One solution is to wrap the forwardRef in a React.memo(forwardRef( /*...*/ )) which will do what I believe is the intent with the above line.
The text was updated successfully, but these errors were encountered:
marcusstenbeck
changed the title
All wrapped effect are re-created on every render
All wrapEffect()-wrapped effects are re-created on every render
Nov 1, 2022
marcusstenbeck
changed the title
All wrapEffect()-wrapped effects are re-created on every render
wrapEffect() re-creates effects on every render regardless of new props or not
Nov 1, 2022
I think the intended behavior is that it should change whenever the props actually change, but this
useMemo
will create a new effect instance on every render.react-postprocessing/src/util.tsx
Line 22 in 33b1ae3
One solution is to wrap the
forwardRef
in aReact.memo(forwardRef( /*...*/ ))
which will do what I believe is the intent with the above line.The text was updated successfully, but these errors were encountered: