Router
The Router
component provides the context for routing in your Hydrogen storefront.
Example code
Anchor link to section titled "Example code"
Name | Type | Description |
---|---|---|
children | Array<ReactElement> | ReactElement |
Any React elements. |
Component type
Anchor link to section titled "Component type"The Router
component is a server component that renders inside App.server.jsx
. For more information about component types, refer to React Server Components.
Considerations
Anchor link to section titled "Considerations"- You should only have one
Router
component in your app. - All
FileRoutes
andRoute
components must be children ofRouter
.