esm-hmr icon indicating copy to clipboard operation
esm-hmr copied to clipboard

mobx

Open leeratyou opened this issue 4 years ago • 4 comments

Wrapping components to mobx's 'observer' (that wrap them in React.memo) prevents hmr to work

    "@snowpack/plugin-react-refresh": "^2.0.3",
    "@snowpack/app-scripts-react": "^1.9.0",
    "mobx": "^5.15.4",
    "mobx-react": "^6.2.3",
    "mobx-react-lite": "^2.0.7",
    "snowpack": "^2.8.0",

leeratyou avatar Aug 18 '20 11:08 leeratyou

Can you include steps that I could reproduce, including code snippets that I can add to a Snowpack app to see this failure in action?

FredKSchott avatar Aug 19 '20 17:08 FredKSchott

@FredKSchott sure repo to reproduce: https://github.com/leeratyou/snowpack-mobx-issue

  1. start project
  2. phone/code any
  3. display to Home screen
  4. edit src/pages/Home
  5. that triggers file change but not Home content

leeratyou avatar Aug 20 '20 07:08 leeratyou

I am interested in this as well. Any examples on how to setup HMR with mobx/MST?

Something like this: https://github.com/mobxjs/mobx-state-tree/issues/372#issuecomment-336145224

Thanks!

dodas avatar Nov 26 '20 01:11 dodas

@leeratyou Any news on that?

ar7casper avatar Jul 21 '21 08:07 ar7casper