mobxjs / mobx-react

React bindings for MobX
https://mobx.js.org/react-integration.html
MIT License
4.85k stars 350 forks source link

Downgrading to mobx-4 for ie11 support #871

Closed kieran-osgood closed 4 years ago

kieran-osgood commented 4 years ago

I'm currently building an app with mobx, I was using: "mobx": "5.*", mobx-react-lite: "^2.0.6" when I realised that mobx 5 isn't supported in ie11, so I downgraded to the latest mobx 4 package: "mobx": "4.15.0" as recommended in the Readme.

That stopped the errors and lets the page load, however (and I'll note, this problem only exists on ie11, if i run the mobx 4 version of my app in chrome, it works just fine), that the observers are no longer working and my components don't re-render?

Is there another step in order to downgrade mobx for ie11 support? I noticed a console warning/info to add import 'mobx-react-lite/batchingForReactDom', I tried with and without this and it didn't make a difference

danielkcz commented 4 years ago

MobX 4 certainly has some limitations in what works for observability due to the different underlying mechanisms. Sadly, there is no overview page of such differences afaik. You need to look at your specific case in the docs. Without knowing what exactly got broken for your with downgrade it's hard to guess.

Also, note that MobX 6 is in the works that will unify this and will be still compatible with IE11. If there is no rush for you to get IE11 compatibility right now, you might be better off with just waiting.

@mweststrate can probably tell more about this.

kieran-osgood commented 4 years ago

I'm going to close this as it turned out the virtual box environment was causing me some issues which were affecting other packages and not mobx, as far as I can tell things seem to be working okay now!

Much appreciate your help @FredyC !