react-hot-loader not saving state #11885
Unanswered
MaxmaxmaximusGitHub
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
if we not add
import 'react-hot-loader'
to top of the any page file, hot reload works not correctly, and not save components states on components reload.if we create custom _app, and add
import 'react-hot-loader'
to top on this file, this not fix it, cuz on client page file (pages/index.js) loaded BEFOREpages/_app
file. and hot reload not applyed.solution for NEXT.js developers:
you must import
import 'react-hot-loader'
on client BEFORE react will imported and before all operations with react will be started, as written in the instructions forreact-hot-reload
temporary solution for NEXT.js users:
Manually add
import 'react-hot-loader'
to top of every page fileBeta Was this translation helpful? Give feedback.
All reactions