rescript-nextjs-template just received some new changes (updated all dependencies, restructured the project directories, added some more helpful comments on the Fast-Refresh mechanisms).
The fast refresh now actually works out of the box with the existing example code. Previously the example code exported React components in a subtly wrong way which caused Fast-Refresh to always do a full page refresh, instead of partially updating the UI.
I don’t know why, but for me it’s quite tricky to just look at ReScript / React file and say: “Yep, this will properly work with fast refresh”, so currently I like to separate
pages/*.js files and ReScript pages completely (more on that in the updated README and example source code).
I also made some additions in the README regarding Tips / Q&A section.
Here is the PR to see all the files that have changed.
Ah, and all code is in ReScript syntax now of course.