Closed lsbyerley closed 3 months ago
So basically, by exporting a component from a route (here resources+), I get encapsulated loader and action for free? Looks like a great solution. I wonder tho, at bundle time, will this split useTheme into its own js file? If so, because useTheme is used at app initialization time, this change could present a risk of slowing down the first render?
This will not negatively impact performance :)
If merged, this PR moves the theme switch component out of root and into it's own full stack component.
I have made this change in my own codebase after coming across https://www.epicweb.dev/full-stack-components and in an effort to reduce bloat in the root file. If this change is not wanted, feel free to close :)
Test Plan
Functionality and display of the theme switch component should not change.
Checklist
Screenshots