Recoil: Mobx-state-tree vs Recoil

Created on 15 May 2020  路  5Comments  路  Source: facebookexperimental/Recoil

I just want to know the differences between mobx-state-tree and this library.

As far my understanding goes mobx-state-tree is independent of UI Library.

Is recoil to used only with react or Will it be a standalone JS library?

Most helpful comment

It seems that as it stands this library is tightly coupled with React as it uses the context api and hooks to manage the state.

All 5 comments

It seems that as it stands this library is tightly coupled with React as it uses the context api and hooks to manage the state.

Recoil is tightly tied to React and will almost certainly remain so. A lot of things about it are designed the way they are specifically to work with newer React features and to be compatible with future React changes.

I am gonna drop this twitter thread here.
https://twitter.com/mweststrate/status/1261369870152871937 by @mweststrate (Author of Mobx)

@davidmccabe MobX creates observable object by cloning the input object and then converts it back to a plain JS object by calling toJS

https://mobx.js.org/refguide/observable.html
https://mobx.js.org/refguide/tojson.html

Does Recoil also clone objects? I'm trying to understand Recoil memory requirements.

Recoil doesn't clone objects like this, though it may freeze them in development mode to help catch errors. It may also cache values which affect memory retention.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

thegauravthakur picture thegauravthakur  路  3Comments

karevn picture karevn  路  3Comments

ymolists picture ymolists  路  3Comments

adamkleingit picture adamkleingit  路  4Comments

eLeontev picture eLeontev  路  3Comments