Mobile development with
React Native
@ilavriv
About Me
Twitter: @ilavriv
GitHub: lavriv92
Front - end Engineer, REMIT.ltd
PLLUG Community - Web branch leader
Speaker, Evangelist, Treveler
Mobile development with JavaScript
Cordova
PhoneGap
....
Typical problems
Web view
Bad patterns
AngularJS is new problem but not solution
How to resolve
Native app
Native app on JavaScript
React Native
React by Facebook
First Release 2013
Video by Peat Hunt
New revolution in JavaScript ecosystem
Facebook, Instagram, Meduza, ModnaKasta, etc.
React
Shadow DOM
Smart Components
Single data flow (Flux, Redux, etc.)
Introduction to React
import { React } from ‘react’;
class HelloApp extends React.Component {
render() {
return <div>Hello, React Component</div>;
}
}
React Native
Use Native Components in JavaScript
Call events from JavaScript flow
JavaScript Flow
Components
Image
ListView
Text
TabBarIOS
ScrollView
Getting started
npm install react-native-cli
react-native init MyApplication
cd MyApplication
react-native run-android // for android
Open Project in Xcode and press run button
var React = require(‘react-native’);
var { TabBarIOS, NavigatorIOS } = React;
Simple App
render() (
<TabBarIOS>
<TabBarIOS.Item title=”Some tab”>
<NavigatorIOS initialRoute={{ title: ‘Tab Title’ }}></NavigatorIOS>
<TabBarIOS.Item>
</TabBarIOS>
)
Styles
Flexbox
Stylesheets
import { StyleSheet } from ‘react-native’ ;
const { StyleSheet } = React;
const styles = StyleSheet.create({
// your stylesheets
});
Development Stack
Build - Webpack
Transpiler - Babel
Packages - npm
Architecture - Flux, Redux
Data - Fetch, Promise pipes
Webpack
Incremental builds
Watching files
easy configuration
...
Flux
Application structure
/ app
/ components
/ actions
/ stores
/ constants
/ mixins
/ main.jsx
Build process
// webpack.config.js
var path = require(‘path’);
module.exports = {
entry: path.join(__dirname, ‘app/main.jsx’),
output: {
path: path.join(__dirname, ‘/’),
filename: ‘index.ios.js’
},
};
module: {
loaders: [
{
test: /.(jsx|js)$/,
loader: "babel-loader?optional=runtime"
},
]};
Links
https://react.parts/native
https://facebook.github.io/react-native/
https://facebook.github.io/react-native/showcase.html
Any Questions?

Lviv MD Day 2015 Іван Лаврів "Mobile development with React Native"