You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice if there was some way to reference a route directory that is not a route in and of itself.
This would prevent having to create and maintain fragile copies of grouped route resources like layout, page, loading, error, not-found, etc.
Background
Some route resources might be needed in multiple parts of an app. Take an add_to_cart modal: it would be nice if all its resources could simply be referenced, rather than copied, and avoid the maintenance burden imposed by duplicated code.
Proposal
Maybe some Reference Route directory at the root to go along with a reference convention in routes. Using a tilde, the following structure would create routes for /product/[x]/add_to_cart and /something_else/add_to_cart without having to duplicate all the files associated with add_to_cart.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Goals
It would be nice if there was some way to reference a route directory that is not a route in and of itself.
This would prevent having to create and maintain fragile copies of grouped route resources like layout, page, loading, error, not-found, etc.
Background
Some route resources might be needed in multiple parts of an app. Take an add_to_cart modal: it would be nice if all its resources could simply be referenced, rather than copied, and avoid the maintenance burden imposed by duplicated code.
Proposal
Maybe some Reference Route directory at the root to go along with a reference convention in routes. Using a tilde, the following structure would create routes for /product/[x]/add_to_cart and /something_else/add_to_cart without having to duplicate all the files associated with add_to_cart.
I think allowing Catch-Alls in parts other than the last segment would allow this more simply but less flexibly.
Beta Was this translation helpful? Give feedback.
All reactions