Summary
ThemeProvider is a custom theme management system with light/dark mode, localStorage persistence, and system preference detection. Has TypeScript safety issues, stale closure bugs, and obsolete CSS.
Improvements
2. Fix missing useCallback dependencies
setTheme callback (line 125) is missing storageKey in dependency array — can cause stale closure bugs
handleMediaQuery callback (line 137) is missing enableSystem dependency
3. Fix invalid JavaScript string generation (line 278)
val construction uses name + "|| ''" which creates syntactically invalid JavaScript in the injected script.
5. Add onThemeChange callback
No event hook for applications that need to react to theme changes.
Moved to Cross-Cutting Issues
The following items have been moved to cross-cutting issues that address them across all components:
Files
packages/raystack/raystack/components/theme-provider/
Summary
ThemeProvider is a custom theme management system with light/dark mode, localStorage persistence, and system preference detection. Has TypeScript safety issues, stale closure bugs, and obsolete CSS.
Improvements
2. Fix missing useCallback dependencies
setThemecallback (line 125) is missingstorageKeyin dependency array — can cause stale closure bugshandleMediaQuerycallback (line 137) is missingenableSystemdependency3. Fix invalid JavaScript string generation (line 278)
valconstruction usesname + "|| ''"which creates syntactically invalid JavaScript in the injected script.5. Add
onThemeChangecallbackNo event hook for applications that need to react to theme changes.
Moved to Cross-Cutting Issues
The following items have been moved to cross-cutting issues that address them across all components:
Files
packages/raystack/raystack/components/theme-provider/