frontarm / navi

🧭 Declarative, asynchronous routing for React.
https://frontarm.com/navi/
MIT License
2.07k stars 71 forks source link

Example with CRA and hot module loading #127

Closed lookfirst closed 5 years ago

lookfirst commented 5 years ago

Can't seem to get HMR to work. Things that are routed to aren't being updated.

lookfirst commented 5 years ago

Looks like this is a WIP still:

https://github.com/facebook/create-react-app/issues/7227

jamesknelson commented 5 years ago

I haven't used hot reloading myself, but from the little I understand, hot module loading doesn't work so well with Navi because the routes are not components.

It may be possible to get it to work, but doing so I think would require changes to Navi itself, so that the matchers understand how to be reloaded and keep their state.

lookfirst commented 5 years ago

Ah, interesting. You are probably right with that. Something to consider for the future I guess.

lookfirst commented 5 years ago

FYI, I did get HMR + react-hot-loader working with parcel, but I don't fully trust it. If you're using latest react with hooks, you have to do the config here. It feels like there is just too many gotchas and I'm afraid it will screw things up during development. So we are back at just reloading the page, which is kind of lame. 2019 and we are still reloading the page to see changes. lol. I'm going to close this since it isn't really an issue with this library.

jamesknelson commented 5 years ago

Ok, thanks for the update.