Description
Currently, we are using deeply nested React Context providers for global state (like Theme, UI state, User preferences). This causes unnecessary re-renders of the entire component tree when minor state changes happen.
Proposed Solution
- Install
zustand.
- Create a global store for UI/Theme preferences.
- Replace
useContext hooks in individual components with Zustand selectors to ensure components only re-render when their specific piece of state changes.
Expected Outcome
A significantly faster React tree with zero unnecessary re-renders.
Description
Currently, we are using deeply nested React Context providers for global state (like Theme, UI state, User preferences). This causes unnecessary re-renders of the entire component tree when minor state changes happen.
Proposed Solution
zustand.useContexthooks in individual components with Zustand selectors to ensure components only re-render when their specific piece of state changes.Expected Outcome
A significantly faster React tree with zero unnecessary re-renders.