- Build mobile apps using JavaScript
- Facebook Open Source
- Learn Once, Write Anywhere
Does the JS compile to native code? No.
JavaScript ➡️ Bridge ➡️ Native code
import React from 'react';
import { AppRegistry, Button, Text, View } from 'react-native';
const Counter = ({ value }) => (
<Text>State value is: {value}</Text>
);
class App extends React.Component {
constructor(props) {
super(props);
this.state = { value: 42 };
}
handleOnClick = () => {
this.setState(prevState => ({ value: prevState.value + 1 }));
}
render() {
return (
<View style={{ fontSize: '1.2em', margin: '1em' }}>
<Counter value={this.state.value} />
<Button onPress={this.handleOnClick} title="INCREMENT" />
</View>
);
}
}
AppRegistry.registerComponent('App', () => App);
import React from 'react';
import { AppRegistry, Button, Text, View } from 'react-native';
const Counter = ({ value }) => (
<Text>State value is: {value}</Text>
);
class App extends React.Component {
constructor(props) {
super(props);
this.state = { value: 42 };
}
handleOnClick = () => {
this.setState(prevState => ({ value: prevState.value + 1 }));
}
render() {
return (
<View style={{ fontSize: '1.2em', margin: '1em' }}>
<Counter value={this.state.value} />
<Button onPress={this.handleOnClick} title="INCREMENT" />
</View>
);
}
}
AppRegistry.registerComponent('App', () => App);
Remember the similar slide about React? 😎
+
- Universal Windows Platform by Microsoft
- Plenty of third-party components/bridges
- An ever-growing community
A service by Microsoft to automatically push (OTA) updates to your mobile applications.
Skip the submission to Google Play/App Store 🚀
- Debugger in Chrome
- Fast feedback loop
- Live/Hot reload is ❤️❤️❤️