Slide about React Native at RSJS 2017 talk. The main goal of this presentation was to show the difference between React Native and hybrid applications, as well, how it works under the hood.
MOBILE DEVELOPMENT WITHreact native
View Slide
Rodrigo boniattiDeveloper at Codeminer 42Student at Universidade FeevaleGithub: boniattirodrigoTwitter: @boniattirodrigoWebsite: rodrigoboniatti.com
Mobile applicationsusing javascriptand react
IT’S REALLY NATIVE
Your code
from React Native: Under the hood slides
it isn’t a webview
HybridNative
Developerenvironment
use your favoriteeditor
use your deviceor simulator
debug in thebrowser
Friendly errormessages
let’s get started
react-native init AwesomeProjectcd AwesomeProjectreact-native run-ios
__tests__androidindex.android.jsindex.ios.jsiosnode_modulespackage.json
Components
→ , → → , →
import React, { Component } from 'react';import {AppRegistry,Text,View} from 'react-native';class MyComponent extends Component {render() {return (Hello World);}}AppRegistry.registerComponent('AwesomeProject', () => MyComponent);
Button ListView MapView NavigatorPicker ScrollView Slider StatusBarSwitch Text TextInput View
How to use acomponent?
import {Text,View,ListView,ScrollView,Image,// . . .} from 'react-native';
import {Text,ScrollView,} from 'react-native';class Carousel extends Component {render() {return (Lorem ipsum...Lorem ipsum...Lorem ipsum...Lorem ipsum...);}}
backgroundColor: 'red',padding: 20,fontSize: 16,}}>
usIng props
horizontal={true}pagingEnabled={true}>
using methods
You can use thenative code too
also, you can have twodifferent files for eacho.s.
carousel.ios.jscarousel.android.js
Style
class MyTextComponent extends Component {render() {return (Lorem ipsum ...)}}const styles = StyleSheet.create({text: {padding: 20,fontSize: 16,backgroundColor: 'red',},});
it uses flex-box
Separation ofconcerns
Architecture
Shadow queue (Native UI)Main thread (Bridge)JS thread (JS Code)
60 FPS
16.6 MS/FRAME
showcases
Myntra FacebookAds ManagerSee more showcases: https://facebook.github.io/react-native/showcase.html
Checkout: //engineering.instagram.com/react-native-at-instagram-dd828a9a90c7
Advantages
If you know React, youcan easily catch that
VIBRANTECOSYSTEM
Learn oncewrite anywhere
Don't Waste TimeRecompiling
some bad points
it’s a newtechnology
shortdocumentation
stranger bugs
conclusion
questions?
thanksSpeaker Deckhttps://speakerdeck.com/boniatti/mobile-development-with-react-native