Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
React Native
Search
Sing Jie Lee
April 22, 2016
Technology
92
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
61
Sprite Kit
singjie
0
64
SiriKit
singjie
0
210
Arduino
singjie
0
45
Software Engineering
singjie
0
61
Advanced Core Data
singjie
0
44
Amazon Echo and Home Integration
singjie
0
110
CS3216 Garena Project X
singjie
0
56
Life
singjie
0
44
Other Decks in Technology
See All in Technology
AWS ネットワーク構築でハマった(ハマりかけた) 5選とそこから得た教訓
nagisa53
4
210
まちスペース®とデジタルツインと「まちづくり」
hiro_ogi
0
110
【CEDEC2026】『ウマ娘 プリティーダービー』 英語版のキャラクターの方言や口調をローカライズするための創造的アプローチ
cygames
PRO
2
560
【CEDEC2026】ゲームシナリオライターを支援するAIツール開発の実践 ― 設計とプロンプトの工夫 ―
cygames
PRO
1
830
Genie Codeハンズオン基礎編
taka_aki
1
120
同じWAFが、攻撃の“形”は弾く── 正当な“形”の不正は通す
kuroneko13
0
180
Flutterをカメラで動かしたかった話
sony
1
140
認知負荷をGemini で溶かす — GKE 基盤「Orbit」における AI エージェントの実践
sansantech
PRO
1
300
修正PRを食べてレビュースキルが賢くなる:Claude Codeによる自己改善サイクル
yuyaumetsu
6
1.5k
Breaking the Seal: Static Deobfuscation of Compiled V8 JavaScript Bytecode Malware
hshrzd
0
740
ボトムアップ文化が強い組織で セキュリティをどう根付かせていくかの現在進行形の話 / Making Security Stick in a Bottom-Up Organization
yamaguchitk333
0
220
カートの信頼性を担保するWireMockを使ったe2eテスト
ykagano
0
250
Featured
See All Featured
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
430
Building the Perfect Custom Keyboard
takai
2
840
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.7k
Become a Pro
speakerdeck
PRO
31
6.2k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
4.3k
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
210
The Curious Case for Waylosing
cassininazir
1
450
A Soul's Torment
seathinner
6
3.4k
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
66
57k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
420
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.8k
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