Closed sanchezweezer closed 2 years ago
Documenting that I'm seeing the same errors with fast refresh using create react app (using the Kea CRA template).
The solution for CRA for now is to add FAST_REFRESH=false
to .env
unfortunately.
I'd love to solve this though. Right now it seemed that React or something is just calling the cleanup function of useEffect
inside useMountedLogic
inside useValues
, which then removes the values from redux. I'm not sure why as hooks shouldn't change with fast refresh.
I found a fix for the crashing. I'll release it with Kea 2.4 as soon as I track down one last issue. With the patch applied, if using React.StrictMode
logics just won't refresh. Without strict mode, everything works. We won't hot-replace logic, but it'll be unloaded and loaded as needed. I think that's good enough for now :)
Kea 2.4 is out with support for this. In case logics don't reload after a change, just disable React.StrictMode for now. :|
after edit file with logic (then it mounted) in expo it fails on fast refresh, because of fast refresh mechanism.