Replies: 2 comments 1 reply
-
This would be a great question for the Call Kent Podcast. Would you be willing to ask there? |
Beta Was this translation helpful? Give feedback.
-
I must admit I have the same thoughs on root.tsx - not only the length, but separation of concerns and a bit around the functionality, so I'll put in some notes here:
One possibility would be to have a pathless theme route that wraps the app. The userPrefs.theme property of the root loader would of course be moved to the new loader. But it is just annoying to have this composition of functionality exposed in the routes I think, so don't like it. Another solution would be to use a "Fullstack component" like you suggest in your fine article: https://www.epicweb.dev/full-stack-components. Only thing is, we need to make an immediate submit on the fetcher on the server, but not on the client - so there would be some logic making sure it only runs on server. Just my 5 pennies - thx. for your awesome inspiration! |
Beta Was this translation helpful? Give feedback.
-
Hi,
I want to learn the design principles of this template.
root.tsx
is over 300 lines. Is there a reason for keeping all the functions in one file? Why don't you split each function in separate a file and import it?Beta Was this translation helpful? Give feedback.
All reactions