How to use Mobx with react-rails?
See original GitHub issueIs 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:
- Created 5 years ago
- Comments:6 (3 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I figured out, this a repo with the setup to make all work! https://github.com/pioz/rails_with_react-rails_and_mobx
Glad to hear it worked OK. Well done and thanks for linking the solution 👍