FredKSchott / esm-hmr

a Hot Module Replacement (HMR) API for your ESM-based dev server.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

mobx

leeratyou opened this issue · 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",

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
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

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

Something like this: mobxjs/mobx-state-tree#372 (comment)

Thanks!

@leeratyou Any news on that?