Provide better DX on route data loading #2627
nikitavoloboev
started this conversation in
Ideas
Replies: 1 comment
-
I thought as my loader and error part is reused across my routes (perhaps that's not wise). I would define it in |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Coming from this Discord discussion which has lots of context.
Currently all my routes are looking like this:
The problem with above is that all my route data fetching ends up looking like this. Where the only thing that changes is this line:
My convention for naming actions is this (but that is not as important):
I thought it would be great to have a system like this perhaps:
With some way to use this
data
in theRouteComponent
Or not really sure but I def need a way to avoid all this boilerplate for route loading as it seems the router should be able to handle this well.
@schiller-manuel said it's good to create some kind of utility like
createQueryFileRoute
for this.Beta Was this translation helpful? Give feedback.
All reactions