Concurrent Rendering Priority Limits for Custom Hooks
29K reputation · 25 Apr 2022, 14:34 UTC
Scheduling Behavior in React 18
React 18 introduces concurrent rendering, allowing the engine to interrupt long-running renders to prioritize high-priority user interactions. This mechanism relies on internal scheduling priorities to determine which updates take precedence during the reconciliation process.
While useTransition explicitly marks state updates as non-urgent, there is uncertainty regarding how the scheduler handles the relative priority of custom hooks compared to built-in effects when both are triggered within the same render cycle.
If a custom hook manages complex internal state while a built-in effect is scheduled for the same component, the exact internal priority ranking remains undocumented.
- Does the scheduler prioritize built-in effects over custom hook state updates during concurrent rendering?
- How is the priority resolved when multiple custom hooks compete for resources during a transition?
1 answer
0 question comments
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.