Currently, ThemeWrapper (ThemeContext Provider) is being used in both main.tsx and App.tsx, which leads to duplicate context wrapping.
Problem
- ThemeWrapper is wrapped twice in the component tree
- This creates multiple instances of the same context
- It may cause unnecessary re-renders and inconsistent theme state behavior
Current Structure
- main.tsx → ThemeWrapper
- App.tsx → ThemeWrapper (again)
Impact
- Performance overhead due to duplicate providers
- Potential theme toggle inconsistency
- Poor React architecture practice
- Harder debugging and maintenance
Expected Behavior
ThemeWrapper should be used only once at the root level (in main.tsx), and removed from App.tsx.
Suggested Fix
Remove ThemeWrapper from App.tsx and keep it only in main.tsx.
Additional Notes
This follows React best practices where Context Providers should wrap the app only once at the top level.
Contributor Checklist
Currently,
ThemeWrapper(ThemeContext Provider) is being used in bothmain.tsxandApp.tsx, which leads to duplicate context wrapping.Problem
Current Structure
Impact
Expected Behavior
ThemeWrapper should be used only once at the root level (in main.tsx), and removed from App.tsx.
Suggested Fix
Remove ThemeWrapper from App.tsx and keep it only in main.tsx.
Additional Notes
This follows React best practices where Context Providers should wrap the app only once at the top level.
Contributor Checklist