gaearon/react-hot-loader

hmr no work in React.PureComponent

zhaopan-pan opened this issue · 2 comments

Description

It's strange that my component can't trigger HMR normally in React.PureComponent, but it's normal in React.Component.
HMR works fine if I replace React.PureComponent in Routes with React.Component.
Has anyone encountered such a problem?

Expected behavior

React.PureComponent can be use HMR

Actual behavior

bug
20230111105644

Environment

"react-hot-loader": "^4.13.1",
"react": "^17.0.2",
"webpack": "^4.44.2",
"webpack-dev-server": "^3.11.2",
node: v14.19.1
chrome:108.0.5359.124

React-Hot-Loader has a special logic to trigger force re-render in PureComponents and cause update of affected components... which was never tested for React 17. So something might got broken here and there.

Unfortunately, the fix is not coming, at least from my side - #1848

all right, I think it's time use react-refresh to replace RHL.
thank you for your reply