question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to use Mobx with react-rails?

See original GitHub issue

Is there a way to use mobx-react with react-rails? If I import mobx-react (import {observer} from 'mobx-react') in my jsx files I get the follow error:

Error: Cannot find module 'react-dom' from '/Users/pioz/Code/.../node_modules/mobx-react'

and if I add react-dom with yarn add react-dom all crash with this error:

Uncaught TypeError: Super expression must either be null or a function, not undefined

Any idea?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
piozcommented, Apr 9, 2018

I figured out, this a repo with the setup to make all work! https://github.com/pioz/rails_with_react-rails_and_mobx

0reactions
BookOfGregcommented, Apr 9, 2018

Glad to hear it worked OK. Well done and thanks for linking the solution 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do you use mobx with react rails? - Stack Overflow
While trying to use react-rails, I've been running into issues incorporating mobx as state management into my app.
Read more >
Using: Mobx with React | Ruby Jane Cabagnot
We do this by using React.createContext, which comes as part of React itself with no additional packages needed. 1.
Read more >
Manage the state of your React app with MobX
Now let's use MobX to observe each of the changes/interactions made in our state. So our list property will be observable, while the...
Read more >
React integration - MobX
As a rule of thumb, use MobX observables when the state captures domain data that is shared among components (including children). Such as...
Read more >
Introduction to Mobx and React - Leigh Halliday
In this video tutorial I show how to get up and running with Mobx in a React app. We will go from create-react-app...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found