Closed ManuelDeLeon closed 7 years ago
Definitely want to push for it.
All systems are GO...
import { Text } from 'react-native';
Test({
render(){
<Text>Hello from ViewModel!</Text>
}
})
Pick up v1.0.1 and be sure to import "babel-polyfill";
on index.android.js and index.ios.js
Just to be clear, most bindings won't work on native components so you need to wire them manually:
Example({
checked: true,
render() {
<CheckBox
label='Label'
checked={ this.checked() }
onChange={ (checked) => this.checked(checked) }
/>
}
});
So far it seems that say for example with:
Example({
checked: true,
render() {
<CheckBox
label='Label'
checked={ this.checked() }
onChange={ (checked) => this.checked(checked) }
/>
}
});
I have to export it out: export default Example;
or else I'd get an error when passing it around stating object is not a class, from a string, etc...
. Could it be as a result of my project being configured incorrectly, or something preventing VM from generating the exports?
import { Example } from './Example/Example';
It doesn't export the class as default.
Alright, thanks :).
I forgot to mention, you can still use "if" and "repeat" bindings because
they happen at compile time. So
On Thu, Oct 27, 2016 at 1:32 PM, Kenta Iwasaki notifications@github.com wrote:
Alright, thanks :).
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/ManuelDeLeon/viewmodel-react/issues/13#issuecomment-256745826, or mute the thread https://github.com/notifications/unsubscribe-auth/AED31ngaxUB3Qmx0ji7E1erpb-WUteIyks5q4PxUgaJpZM4KTPNK .
Right now react-dom is a hard dependency. If it's
require('react-dom')
'd then ViewModel should work with React Native.That's the theory at least...