Comments (5)
I didn't built a react-native project myself using mobservable, but I know there are some people on the gitter / reactiflux channel who did so probably you can ask around in these channels.
Besides that, integration mobservable with react native is really easy; just use the @observer
decorator on your react native components instead of on JSX based components, that should be all. If you don't use ES6 syntax, just pass your components through observer
: var myNativeComponent = mobservableReact.observer(React.createClass({ .. }));
from mobx-react.
I've tried but it didn't work.
"import observer from mobservable-react/native" and "export default observer(myComponent)" didn't make the trick. It ends up in different errors for different versions of react native. So I might miss something.
A working demo would greatly help.
from mobx-react.
Note that it should be ..import {observer} from
"mobservable-react/native".. If that doesn't help I'm gonna try to find
somebody who uses it with native for you :)
On Wed, Jan 20, 2016 at 3:08 AM, jjchula [email protected] wrote:
I've tried but it didn't work.
"import observer from mobservable-react/native" and "export default
observer(myComponent)" didn't make the trick. It ends up in different
errors for different versions of react native. So I might miss something.A working demo would greatly help.
โ
Reply to this email directly or view it on GitHub
#16 (comment)
.
from mobx-react.
Right! It's working now. Many thanks.
I was too lazy so I took the code from README.md. Noted the broken link.
Installation
...
import observer from 'mobservable-react';
// - or -
import observer from 'mobservable-react/native';
This package provides the bindings for Mobservable and React. See the broken link for how to get started.
from mobx-react.
Ouch, that's really embarrassing. Fixed it. Thanks for reporting!
from mobx-react.
Related Issues (20)
- upgrade mobx-react version from 6.2.2 to 6.2.3๏ผThere is an error HOT 7
- observer component re-renders even though observed value doesn't change HOT 4
- build 6.2.4 is broken (missing files) HOT 1
- [mobx-react 6.2.4] Unable to resolve path to module 'mobx-react' HOT 2
- Why not copy static propertities in prototype ? HOT 1
- Attempted import error: 'observerBatchingOptOut' is not exported from 'mobx-react-lite'. HOT 9
- Uncaught TypeError: Cannot add property Symbol(isMobXReactObserver), object is not extensible HOT 2
- New version is breaking previous versions (Error: mobx-react-lite@3 requires mobx at least version 6 to be available) HOT 5
- Problem with version 6.3.0 and mobx v5 HOT 11
- Unable to resolve module `./assertEnvironment` HOT 19
- Document `enableStaticRendering` HOT 5
- The problem of `useRef` to keep the store instance HOT 2
- What is the best way to deal with large and dynamic FlatLists? HOT 3
- mobx-react.js.org dead? HOT 1
- deepEqual condition for re-rendering? HOT 9
- observer does not re-render components in React Native HOT 10
- observer doesn't re-render functional components HOT 2
- Not working in nextjs using mobx:6.0.1 HOT 2
- Incosistencies in mobx-react dependency versions. HOT 1
- Migration guide for mobx6 + mobx-react7? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mobx-react.