It proved quite hard to find a way to do HMR in ReasonReact.
Here’s a quick but dirty way of doing it:
Initialize an app using reason-scripts
After having installed the bucklescript platform you can run:
yarn create react-app reasonreact-hmr -- --scripts-version reason-scripts
Replace your src/index.re file with this:
What’s actually going on?
I took the js code that is generated from the original index.re and modified it to support HMR.
The require statements you see are the ones generated by reason when you run the project for the first time.