Skip to content
This repository has been archived by the owner on Dec 31, 2020. It is now read-only.

React-native project using mobservable-react #16

Closed
jjchula opened this issue Jan 18, 2016 · 5 comments
Closed

React-native project using mobservable-react #16

jjchula opened this issue Jan 18, 2016 · 5 comments

Comments

@jjchula
Copy link

jjchula commented Jan 18, 2016

Thank you for the Boilerplate projects. But they are for JSX or the web.
Would you provide a React-native project using mobservable-react or point me to a demo please?

@mweststrate
Copy link
Member

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({ .. }));

@jjchula
Copy link
Author

jjchula commented Jan 20, 2016

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.

@mweststrate
Copy link
Member

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 notifications@github.com 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)
.

@jjchula
Copy link
Author

jjchula commented Jan 20, 2016

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.

@mweststrate
Copy link
Member

Ouch, that's really embarrassing. Fixed it. Thanks for reporting!

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

No branches or pull requests

2 participants