More Related Content
Similar to Ba Node.js Meetup React Native Presentation (20)
Ba Node.js Meetup React Native Presentation
- 3. REACT
var HelloMessage = React.createClass({
//… more code here
render: function() {
var suffix = this.state.greeted ? “again.” : “”;
return <div>Hello {this.props.name} {suffix}</div>;
}
});
ReactDOM.render(<HelloMessage name="John" />, mountNode);
- 4. REACT
var HelloMessage = React.createClass({
//… more code here
render: function() {
var suffix = this.state.greeted ? “again.” : “”;
return <div>Hello {this.props.name} {suffix}</div>;
}
});
ReactDOM.render(<HelloMessage name="John" />, mountNode);
- 5. REACT
var HelloMessage = React.createClass({
//… more code here
render: function() {
var suffix = this.state.greeted ? “again.” : “”;
return <div>Hello {this.props.name} {suffix}</div>;
}
});
ReactDOM.render(<HelloMessage name="John" />, mountNode);
- 6. REACT
render: function render() {
var suffix = this.state.greeted ? “again.” : “”;
return React.createElement(
"div",
null,
"Hello ",
this.props.name,
“ “,
suffix
);
}
- 7. REACT
var React = require('react');
var ReactDOM = require('react-dom');
var HelloMessage = React.createClass({
//… more code here
render: function() {
var suffix = this.state.greeted ? “again.” : “”;
return <div>Hello {this.props.name} {suffix}</div>;
}
});
ReactDOM.render(<HelloMessage name="John" />, mountNode);
- 11. REACT NATIVE
import React from ‘react-native';
var { AppRegistry, View, Text } = React;
var SuperTimer = React.createClass({
render: function() {
return (
<View>
<Text>Hello world!</Text>
</View>
);
}
});
AppRegistry.registerComponent('SuperTimer', () => SuperTimer);
- 17. REACT NATIVE
PLATFORM SPECIFIC
▸CROSS PLATFORM (ie: ListView, Image, etc…)
▸POLYFILLS (ie: navigator.geolocation, etc…)
▸iOS (ie: ActivityIndicatorIOS, PushNotificationsIOS, etc…)
▸Android (ie: DrawerLayoutAndroid, ToastAndroid, etc…)
▸index.ios.js & index.android.js
- 18. REACT NATIVE
STYLES
▸CSS-LIKE
▸FLEXBOX SUBSET
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
},
welcome: {
fontSize: 20,
textAlign: 'center',
margin: 10,
},
instructions: {
textAlign: 'center',
color: '#333333',
marginBottom: 5,
},
});
http://browniefed.com/blog/2015/12/23/react-native-flexboxfroggy/