-
-
Notifications
You must be signed in to change notification settings - Fork 125
Issue with react-hot-loader #457
Description
I'm using react-hot-loader for preserving component's state on HMR. This seems to work. But on the very first change after initial page load I get this error:
The change itself is applied and also state is preserved. Every further change runs without this error and is applied as well.
I tried using preact-deep-force-update
resolve : {
alias: {
'react': 'preact-compat',
'react-dom': 'preact-compat',
'create-react-class': 'preact-compat/lib/create-react-class',
'preact-compat': 'preact-compat/dist/preact-compat',
'react-deep-force-update': 'preact-deep-force-update'
},
extensions : [ '.tsx', '.ts', '.js' ]
},but then the feature of preserving state is not and only pure HMR is working.
As you can see on the screenshot am even starting my project and I'm using preact for the first time. So I'm not sure the react-hot-loader is fully operational when I get this error. I hope you can tell me whether subsequent code of the function causing the error matters to preact HMR or you even can provide a workaround/solution for this issue.
Thx,
Stephan
By the way: I'm using Typescript and not Babel. But I don't think this matters at all.
PS: My dependencies are
"dependencies": {
"preact": "^8.2.7",
"preact-compat": "^3.17.0"
},
"devDependencies": {
"react-hot-loader": "^3.1.3",
"preact-deep-force-update": "0.1.0",
....
