It seems that hot reloading of React components is not working in Phoenix 1.5 with webpack. I created this sample app to illustrate the problem I’m experiencing: GitHub - johnnyicon/phx15-react-babel-tailwindcss-postcss: Example app
./assets/js/react/App.js are not being automatically reloaded. Refreshing the page does not reflect the change either. I have to restart the Phoenix server in order for the changes to show.
I can edit other files, like template files (
*.html.eex) and they reload fine. The interesting thing, however, is even when the other files reload, the React component still doesn’t update.
Any ideas how to get hot reloading working with React components?
PS. loosely followed this tutorial to set up React in a Phoenix 1.5 project: https://betterprogramming.pub/using-react-17-with-phoenix-1-5-1b445526c739