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
No warning appears for arr being potentially constructed on every render.
The expected behavior
Should warn that arr can be constructed on each render.
The lint rules already warn for the following, so this is just an extension of the existing behavior:
constarr=props.arr??[];// The 'arr' logical expression could make the dependencies of useEffect Hook (at line 54) change on every render. Move it inside the useEffect callback. Alternatively, wrap the initialization of 'arr' in its own useMemo() Hook.
I can't guarantee whether this is accepted. I'm just triaging issues. But considering similar efforts were included (#19590) there's a good chance it will.
So feel free to work on it 👍 If you're stuck at any point you can share you progress and ask for help.
React version: 17.0.1
Steps To Reproduce
Link to code example: --
The current behavior
No warning appears for
arr
being potentially constructed on every render.The expected behavior
Should warn that
arr
can be constructed on each render.The lint rules already warn for the following, so this is just an extension of the existing behavior:
Reference: #19590
The text was updated successfully, but these errors were encountered: