State Management · Senior · Question 65 of 75
Why does React Redux implement useSelector on top of useSyncExternalStoreWithSelector?
- ✓Correct answer: To subscribe to the external store safely in concurrent rendering and re-render only when the selected value changes
- 2To make reducers asynchronous
- 3To avoid using Context at all
Explanation
The selector runs on every store change, and the result is compared (by === or a custom equality) before React schedules a render.