Join GitHub today
Support hot-reloading route data #452
I like the premise and benefits presented by
One area where I am struggling is that I'd like the browser to refresh when there are changes to the Markdown files. I've combined these two examples:
In the first example, you can make changes to the markdown test file, but they are not reflected on the browser until you refresh it.
I plan to store the post in markdown under a folder. Based on the first example, I changed the second example to reading the posts folder inside the
I'd appreciate any insight or guidance on how to achieve this please. It's the only thing I am missing to fully embrace this framework for a blog!
Thank you for your time!
I use a library npm-watch for this
Changing a data source should hot-reload on the client with the updated data.
If you are retrieving your data in
Proposed Changes to support this functionality
The problem you're experiencing is that this data is cached on the client, so when you move around your site, you are getting stale data. To make this possible a couple things would need to change in React Static:
Though the most common use case is probably Markdown files, these proposed changes should technically make it feasible to hot-reload when CMS data changes, as long as RS can be notified of that change.