-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Open
Labels
Description
HOLD for #70272
Problem
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
useOnyxthat benefits from using a shared stable reference for selectors. - In [Due for payment 2025-11-14] [$1250] Forbid inline useOnyx selectors #70272 we are going to forbid inline selectors and refactor E/App to ensure all selectors are not inline.
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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
LOW