Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
React Native
Search
Sing Jie Lee
April 22, 2016
Technology
100
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
React Native
Sing Jie Lee
April 22, 2016
More Decks by Sing Jie Lee
See All by Sing Jie Lee
Infocomm Media Youth Festival 2016 - Career Talk
singjie
0
62
Sprite Kit
singjie
0
66
SiriKit
singjie
0
210
Arduino
singjie
0
48
Software Engineering
singjie
0
63
Advanced Core Data
singjie
0
48
Amazon Echo and Home Integration
singjie
0
120
CS3216 Garena Project X
singjie
0
59
Life
singjie
0
47
Other Decks in Technology
See All in Technology
会社説明資料
persolserverworks
0
9.8k
スキマバイトという雇用形態は存在しないので、雇用期間1日のアルバイト契約を事業者とワーカーが結ぶ手続きを支えるのがタイミーなんです
akitoshiga
0
200
フロントエンドカンファレンス関西2026 - 速すぎるUIに、待ち時間を
teamlab
PRO
0
130
ストレスなくAIと付き合いたい!こんなときどうしてる?
namiki64
3
490
パスキーの自動テストはどこまでいけるのか
teamlab
PRO
0
200
その Valkey 使いこなしていますか?
onk
PRO
5
1.5k
ブラウザとサーバーから考えるAI時代のフロントエンド監視
shogo4131
3
940
Temporal 最高!でも改めて「日付」について調べたら人類の負債すぎる件
riyaamemiya
0
150
PHPカンファレンス関西の招待状 / Invitation to PHP Conference Kansai
ykanoh
0
110
今さら理解するウェブフォントver.2026
takanorip
3
770
AIカンパニーへの転換を支えた、エンジニアの仕事の再定義
kworkdev
PRO
2
1.2k
Metadata - Section 1: HTML Basics
mohab1
0
120
Featured
See All Featured
Heart Work Chapter 1 - Part 1
lfama
PRO
10
37k
Reality Check: Gamification 10 Years Later
codingconduct
0
2.3k
Abbi's Birthday
coloredviolet
4
10k
Google's AI Overviews - The New Search
badams
0
1.6k
How to train your dragon (web standard)
notwaldorf
96
6.9k
Marketing to machines
jonoalderson
1
5.9k
We Are The Robots
honzajavorek
0
400
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.5k
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
430
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
3
1.3k
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
320
Ten Tips & Tricks for a 🌱 transition
stuffmc
1
270
Transcript
REACT NATIVE LEE SING JIE
CREATED BY FACEBOOK
– https://facebook.github.io/react-native/ “The focus of React Native is on developer
efficiency across all the platforms you care about — learn once, write anywhere.”
PROBLEMS WITH NATIVE • Slow development cycle • Slow deployment
cycle • Different API for same thing • Separate platform teams
WEB / CROSS-PLATFORM • Poor Performance • Non-Native Feel •
Limited feature support • Hackish
None
None
REACT NATIVE • Slow development cycle • Slow deployment cycle
• Different API for same thing • Separate platform teams • Instant Reload • OTA Updates • Common APIs • Shared Skill set
ADVANTAGES • CMD+R • Javascript! Learn once, write anywhere •
Functional UI • Flexbox layout • Highly extensible
JAVASCRIPT import React, { AppRegistry, Component, StyleSheet, Text, View }
from 'react-native'; class EmmaLee extends Component { render() { return ( React.createElement(Text, {style: styles.welcome}, “Welcome to React Native!”) ); } } var styles = StyleSheet.create({ welcome: { fontSize: 30,textAlign: ‘center’ } }); AppRegistry.registerComponent('EmmaLee', () => EmmaLee);
JSX import React, { AppRegistry, Component, StyleSheet, Text, View }
from 'react-native'; class EmmaLee extends Component { render() { return ( <Text style={styles.welcome}> Welcome to React Native! </Text> ); } } var styles = StyleSheet.create({ welcome: { fontSize: 30,textAlign: ‘center’ } }); AppRegistry.registerComponent('EmmaLee', () => EmmaLee);
ASYNC EXECUTION JavaScript Thread Main Thread Shadow Thread Cache Thread
ASYNC EXECUTION
FLEXBOX LAYOUT • flexDirection • justifyContent • alignItems • flex
• flexWrap
FUNCTIONAL UI import React, { AppRegistry, Component, StyleSheet, Text, View
} from 'react-native'; class EmmaLee extends Component { render() { return ( <Text style={styles.welcome}> Welcome to React Native! </Text> ); } } var styles = StyleSheet.create({ welcome: { fontSize: 30,textAlign: ‘center’ } }); AppRegistry.registerComponent('EmmaLee', () => EmmaLee);
FUNCTIONAL UI this.state this.state.text2 this.state.text1 render() { return ( <View
style={styles.container}> <Text style={styles.text}>{this.state.text1}</Text> <Image style={styles.image} source={{uri: "some_url"}}/> <Text style={styles.text}>{this.state.text2}</Text> </View> ); }
FUNCTIONAL UI this.state I You constructor(props) { super(props); this.state =
{ text1: "I", text2: "You", }; }
FUNCTIONAL UI this.state onSomeEvent() { this.setState({ text1: "Vincent Nguyen", text2:
"Omer Iqbal" }) } Vincent Nguyen Omer Iqbal
LET'S BUILD AN APP
EXTENSIBLE • Native UI Components • Native Modules
NATIVE UI COMPONENTS // RCTMapManager.m #import <MapKit/MapKit.h> #import "RCTViewManager.h" @interface
RCTMapManager : RCTViewManager @end @implementation RCTMapManager RCT_EXPORT_MODULE() - (UIView *)view { return [[MKMapView alloc] init]; } @end import { requireNativeComponent } from 'react-native'; module.exports = requireNativeComponent('RCTMap', null); Objective-C Javascript
NATIVE UI COMPONENTS
DEMO
NATIVE MODULES // CalendarManager.h #import "RCTBridgeModule.h" @interface CalendarManager : NSObject
<RCTBridgeModule> @end // CalendarManager.m @implementation CalendarManager RCT_EXPORT_MODULE(); RCT_EXPORT_METHOD(addEvent:(NSString *)name location:(NSString *)location) { NSLog(@"Pretending to create an event %@ at %@", name, location); } @end import { NativeModules } from 'react-native'; var CalendarManager = NativeModules.CalendarManager; CalendarManager.addEvent('Birthday Party', '4 Privet Drive, Surrey'); Objective-C Javascript
NATIVE MODULES
DEMO
OTA UPDATE "react-native bundle --entry-file index.ios.js -- bundle-output ios.bundle --dev
false"
DEMO
–Chai Haoqiang “I took only two hours to do Shopee
page using React Native”
None
QUESTIONS?
Credits: - http://www.slideshare.net/tlv-ios-dev/pieter-de-baets-an-introduction-to-react-native - https://facebook.github.io/react-native/docs - https://scotch.io/tutorials/a-visual-guide-to-css3-flexbox-properties