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 propose a new rule that reports when a callback function is defined in JSX or would be recreated on every re-render. More generally, such a rule could allow developers to prefer one pattern over the other.
Note: I opened this issue is conjunction with #3682.
The text was updated successfully, but these errors were encountered:
Consider the following:
Both options behave the same. The callback is recreated on every re-render. One might prefer to memoized the callback to avoid this common pitfall:
I propose a new rule that reports when a callback function is defined in JSX or would be recreated on every re-render. More generally, such a rule could allow developers to prefer one pattern over the other.
Note: I opened this issue is conjunction with #3682.
The text was updated successfully, but these errors were encountered: