Feature Request: Layout wrapper option for shared structure across component, pendingComponent, and errorComponent #7474
mt-shihab26
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
|
why don't you use a parent layout route for this? |
Beta Was this translation helpful? Give feedback.
1 reply
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.
-
Problem
When a route needs a shared wrapper (e.g. a page header) across all three states —
component,pendingComponent, anderrorComponent— there is no built-in mechanismto avoid repeating it. Currently you must either:
Layoutcomponent and wrap each state yourselfExample of the current workaround
Suggested API
A
layoutComponent(or similar) option that automatically wraps all three states:Why
This is a common need — most routes have a page header that should remain visible
regardless of whether the route is loading, errored, or ready. The workaround works
but adds noise and is easy to forget when adding an
errorComponent.Beta Was this translation helpful? Give feedback.
All reactions