react-hooks-global-state: react hot load doesnt work

Using react hotloader

import {hot} from 'react-hot-loader'
export default hot(module)(App)

Does not work, is there a way to get it to work without having the state reset every time a hotoad happens?

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 22 (13 by maintainers)

Most upvoted comments

This fixes it if I do exactly as your example. And put render inoto index.js not App.js, which is the correct way to do it anyways. yes can merge

@vans163 I made a full reproduction. Please give it a try. hot-load-example.zip


Not quite sure, but this small example seems working without the patched react-dom. I might misunderstand something.

I needed to delete this line,

ReactDOM.render(<App />, document.getElementById('app'));

but if I remove it, it just works. Can you confirm the environment? Are you using the patched react-dom?