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
110
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
React Native
Sing Jie Lee
April 22, 2016
Transcript
32 slides
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
More Decks by Sing Jie Lee
See All by Sing Jie Lee
Infocomm Media Youth Festival 2016 - Career Talk
singjie
0
69
Sprite Kit
singjie
0
76
SiriKit
singjie
0
220
Arduino
singjie
0
56
Software Engineering
singjie
0
71
Advanced Core Data
singjie
0
54
Amazon Echo and Home Integration
singjie
0
130
CS3216 Garena Project X
singjie
0
66
Life
singjie
0
54
Other Decks in Technology
See All in Technology
現場に渡し、構造で守る AI エージェントを活用したセルフサーブのデータ基盤の運用
legalontechnologies
PRO
0
120
設計手法を「道具」として使いこなすために
a_suenami
7
1.8k
AI-Ready なデータ基盤ってなに? & 新卒未経験が、いま考えていること
imuta
0
1.1k
コーディングできない僕にBobが舞い降りた
shumpei3
0
220
AWS Well-Arhitected Frameworkセキュリティの柱 について
miu_crescent
PRO
2
260
Kiro のリモートワークスペース: IDE は手元のままで、ワークスペースをクラウド、コンテナ、自前のマシンに置く
inariku
PRO
2
220
AWS WAF あなたの推しサービス教えて!LT #jawsugosaka @fillz_noh
fillznoh
1
110
kubellの最新データ分析環境
kubell_hr
2
280
AI-DLCでソフトウェア開発の速さは 上がったのか?
rfdnxbro
0
170
クラウドでも使えるNetApp -現場目線での設計とクラウドバックアップの活用
ryutakondo
1
340
Kubernetes, Agones, WebRTC, GPU で作る クラウドゲーミング基盤を本番運用に乗せるまで
vivion
1
290
Libérez Firefox et Thunderbird avec nos astuces
hellosct1
0
200
Featured
See All Featured
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
790
Navigating Team Friction
lara
192
16k
Building Flexible Design Systems
yeseniaperezcruz
330
41k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
23k
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.7k
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
2
3k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
23k
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
68
61k
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.6k
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
[SF Ruby Conf 2025] Rails X
palkan
3
1.6k
The SEO Collaboration Effect
kristinabergwall1
1
630