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
Selectors in useOnyx are wrapped with useLiveRef to get a stable reference even for inline selectors. This was a helpful convenience when it's added, but some things have changed:
We added a cache for useOnyx that benefits from using a shared stable reference for selectors.
After that's done, useLiveRef will contribute complexity without having any value. Furthermore, it may cause unexpected behaviors, in that useOnyx will not re-run if the selector changes unless you explicitly pass the selector as a dependency.
Solution
Remove the useLiveRef wrapper from selectors in useOnyx. We don't need it anymore.
HOLD for #70272
Problem
Selectors in
useOnyxare wrapped withuseLiveRefto get a stable reference even for inline selectors. This was a helpful convenience when it's added, but some things have changed:useOnyxthat benefits from using a shared stable reference for selectors.After that's done,
useLiveRefwill contribute complexity without having any value. Furthermore, it may cause unexpected behaviors, in thatuseOnyxwill not re-run if the selector changes unless you explicitly pass the selector as a dependency.Solution
Remove the
useLiveRefwrapper from selectors inuseOnyx. We don't need it anymore.