Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use devtools in React Native with Mobx State Tree #367

Closed
alexlevy0 opened this issue Sep 6, 2017 · 4 comments
Closed

Use devtools in React Native with Mobx State Tree #367

alexlevy0 opened this issue Sep 6, 2017 · 4 comments

Comments

@alexlevy0
Copy link

Hello,

I'm trying to use mobx-remotedev with React Native and MobX-State-Tree but I don't know how to do.
I tried with export default remotedev(AppStore, { global: true, remote: true }) in my rootStore but I get an error Unhandled JS Exception: Cannot read property 'create' of undefined cause I create the tree with const appStore = AppStore.create({ users: {} }, { logger: logger })

Can you orient me?

Thanks for readding

@mattiamanzati
Copy link
Contributor

As mobx-remotedev docs says, it expects first parameter to be either a mobx observable value or a class. MST does not use classes, so instead of passing AppStore to remotedev you need to pass appStore (the AppStore model instance).
Let me know if it works! :)

@HaveF
Copy link
Contributor

HaveF commented Jul 24, 2018

@mattiamanzati
I try to using model instance, it seems not work.

TypeError: Cannot read property 'getDebugName' of undefined
init

./node_modules/mobx-remotedev/lib/spy.js:47
  44 | }
  45 | 
  46 | function init(store, config) {
> 47 |   var name = mobx.extras.getDebugName(store);
  48 |   configure(name, config);
  49 |   stores[name] = store;
  50 | 

Add version info:

    "mobx": "^5.0.3",
    "mobx-react": "^5.2.3",
    "mobx-state-tree": "^2.2.0",
    "mobx-remotedev": "^0.2.8",

@mweststrate
Copy link
Member

mweststrate commented Jul 24, 2018 via email

@HaveF
Copy link
Contributor

HaveF commented Jul 24, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants