mobxjs / mobx-react-lite

Lightweight React bindings for MobX based on React 16.8 and Hooks
https://mobx.js.org/react-integration.html
MIT License
2.13k stars 91 forks source link

optimizeForReactDom/Native does not work in IE11 due to destructuring #238

Closed Tarpsvo closed 4 years ago

Tarpsvo commented 4 years ago

Hi!

As the optimizeForReactDomand optimizeForReactNative opt-ins are not transpiled and use object destructuring, they do not work in certain browsers (namely, IE11).

Can we avoid destructuring and just do it a bit more conventionally?

For example:

const ReactDOM = require('react-dom');
require('./dist').optimizeScheduler(ReactDOM.unstable_batchedUpdates);
danielkcz commented 4 years ago

Thanks for the report, you are right. Are you willing to provide PR?

Tarpsvo commented 4 years ago

Definitely, provided a PR at #239.

danielkcz commented 4 years ago

Thank you. Can you also make the same PR to the next branch, please? It might be released soon as 2.0.

Tarpsvo commented 4 years ago

Thanks! PR opened at #240.

danielkcz commented 4 years ago

I thank you :) Published 1.5.1.

Tarpsvo commented 4 years ago

No problem! Thanks for the quick reply, merge and new release!