-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Routing example #63
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall this looks great - I think it effectively communicates how to make use of the basepath hook to enable client/server routing.
It would be helpful to have a README that describes the page creation and usage of [dynamic-slug]
Ah, yes. Totally forgot about including that like we discussed. I will get that added 👍 |
|
||
export const Component = () => { | ||
return ( | ||
<div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a curiosity, is this DIV needed here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope! Just a little leftover cruft 😅
@bmatto updated to showcase dynamic routes and added a readme calling out the important bits. Let me know what you think! |
@@ -0,0 +1,61 @@ | |||
# Routing | |||
With CMS React, you can use popular routing libraries like React-Router to enable SPA-style routing within your CMS website. The Pokedex example in this directory showcases how to set up SPA routing in your own project using React-Router. This documentation will walk through key aspects of our example, but for more information on React-Router, please visit their [docs](https://reactrouter.com/en/main). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This all looks good, the only thing I think is missing is the usage of [:dynamic-slug] within the actual page to enable the SPA routing on the server.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed 299d776
Adds an example of using react-router for a cms-react project.
Screenshots