Closed seivan closed 4 years ago
Yea, unfortunately, there are differences. Generally, if your codebase requires classes, then use the mobx-react
variant, otherwise, stick to mobx-react-lite
only.
@FredyC I am sorry, classes for Observers or Observables? What's the plan ahead, are they going to get merged at some point, or is this split going to stay?
So if I am only using functional components with class observables, should I use mobx-react-lite?
The observer is used with components, so no need to worry about class-based observables.
No particular plan, these types are rather tricky when classes are mixed in. And to be honest I don't see a reason. As I said above, if you need both, stick to mobx-react
. Otherwise, remove mobx-react
and use lite
only because it's more lightweight. And if you need Provider / inject
you can obviously keep using mobx-react
for that, but we recommend migrating away from that.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs or questions.
Which is the more accurate and up to date version?
This works with
mobx-react-lite
used when using"mobx-react": "6.1.8",
But this fails with an error
Their type signatures are different.
mobx-react
usesWhile
mobx-react-lite
usesWhich is the more correct and up to date one?