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
{{ message }}
This repository has been archived by the owner on Feb 14, 2023. It is now read-only.
I'm unsure. useGlobal isn't very standardized, since it has conditional hook usage which is not a great practice, but solved a problem here. It could be that the effect every render solved an edge case bug, or it could have been an oversight!
If this isn't causing a performance bottleneck for your application, I'd recommend leaving it as-is so as not to introduce edge case bugs on the off-chance it'd cause any.
Any future releases of ReactN will contain the hooks lint rule that would prevent this from happening. 😄
Thanks for bringing it to my attention. I'll leave this ticket open, because it's a valid issue; but there's currently no incentive to fix it. Let me know if this is causing you any issues.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The function to add the global listener in
useEffect
will be rerun in every render since no dependency array is provided:https://github.com/CharlesStover/reactn/blob/master/src/use-global.ts#L69-L83
Is this intentional?
The text was updated successfully, but these errors were encountered: