Replies: 1 comment 1 reply
-
I'm also running into issue with this. If I have a match path, the page context is incorrect. If I remove the match path, the content is right, but then I must parse the path on the client and map the path params. If Gatsby could provide example of best practices for nested routes, that would be very helpful. I've spent quite a bit of time fussing with this API because it's not intuitive. |
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
-
When creating pages with createPage. Setting the path and matchPath with added parameters. I would expect both will resolve the same component layout and render the same content. In my case, only the matchPath is rendering components and the original path does not render any.
createPage({
path: slug,
matchPath: slugWithParameters, //Only this renders component
component: layout,
context: {
id
},
});
This is my reach Router:
Shouldn't the path and matchPath render the same content? Do I need to support the original path in the Router as well?
slug can be: "/", "/about", "/products"
slugWithParameters can be: "/:id", "/:id/about", "/:id/products"
Beta Was this translation helpful? Give feedback.
All reactions