Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Easy Way to Improve ReactNative
Search
Sergio Utama
July 12, 2018
Programming
0
270
Easy Way to Improve ReactNative
5 easy way to improve ReactNative project
Sergio Utama
July 12, 2018
Tweet
Share
More Decks by Sergio Utama
See All by Sergio Utama
From try! Swift Tokyo 2017
sergioutama
0
64
Migrating to Swift 3
sergioutama
0
55
Taming AutoLayout
sergioutama
0
47
10 Things I learned while freelancing
sergioutama
0
59
iOS Video Player
sergioutama
0
86
Tribute to Mantle
sergioutama
0
30
Mobile Analytics
sergioutama
0
46
Other Decks in Programming
See All in Programming
エディターってAIで操作できるんだぜ
kis9a
0
710
【CA.ai #3】Google ADKを活用したAI Agent開発と運用知見
harappa80
0
300
AIコーディングエージェント(NotebookLM)
kondai24
0
170
SwiftUIで本格音ゲー実装してみた
hypebeans
0
110
堅牢なフロントエンドテスト基盤を構築するために行った取り組み
shogo4131
8
2.3k
Giselleで作るAI QAアシスタント 〜 Pull Requestレビューに継続的QAを
codenote
0
120
【CA.ai #3】ワークフローから見直すAIエージェント — 必要な場面と“選ばない”判断
satoaoaka
0
240
Tinkerbellから学ぶ、Podで DHCPをリッスンする手法
tomokon
0
120
チームをチームにするEM
hitode909
0
300
生成AIを利用するだけでなく、投資できる組織へ
pospome
1
250
新卒エンジニアのプルリクエスト with AI駆動
fukunaga2025
0
200
非同期処理の迷宮を抜ける: 初学者がつまづく構造的な原因
pd1xx
1
700
Featured
See All Featured
Documentation Writing (for coders)
carmenintech
76
5.2k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.6k
4 Signs Your Business is Dying
shpigford
186
22k
Statistics for Hackers
jakevdp
799
230k
Building Applications with DynamoDB
mza
96
6.8k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.1k
Designing for Performance
lara
610
69k
Build your cross-platform service in a week with App Engine
jlugia
234
18k
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
Being A Developer After 40
akosma
91
590k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.2k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
9
1k
Transcript
Easy way to improve your ReactNative Project by @sergioutama @sergioutama
$ whoami Sergio Utama Just your friendly programmer @sergioutama
Don't Use ReactNative @sergioutama
The end @sergioutama
Just kidding ! @sergioutama
1. Fix your project structure @sergioutama
Why — Easier to navigate and maintain — Mental image
how code should be structured @sergioutama
How ~ components for reusable globaly ~ Split based on
screen OR module ~ each screen has its component @sergioutama
2. Stop using arrow function @sergioutama
Arrow function ( () => {}) is a necessary evil
of js world. It make easy to ignore this @sergioutama
However, arrow function actually assigning a new value. Calling it
within render() function will give significant impact on your app performance @sergioutama
Solution? bind early or declare it outside render() @sergioutama
3. Own your component lifecycle @sergioutama
React gave us PureComponent and shouldComponentUpdate to use. Use it!
@sergioutama
Understand how React lifecycle and avoid unecessary render by extending
PureComponent or implementing shouldComponentUpdate. Be!er: fully utilize the whole lifecycle functions. @sergioutama
@sergioutama
4. Component everything @sergioutama
Keep your component small. It's not a dick measuring contents
If more than 6 elements, move it to a component @sergioutama
5. It's either Component OR PureComponent @sergioutama
const modalClosed = ()=>{} const LoadingOverlay = (props) => {
const { loading, message, ...attributes } = props; const defaultMessage = message || ''; return ( <Modal transparent animationType={'none'} visible={loading} onRequestClose={modalClosed} > <View style={styles.modalBackground}> <View style={styles.activityIndicatorWrapper}> <ActivityIndicator animating={loading} /> <Text style={styles.loadingText}>{defaultMessage}</Text> </View> </View> </Modal> ); }; @sergioutama
const modalClose = () => {}; export default class LoadingOverlay
extends React.Component<Props> { render() { const { loading, message, style } = this.props; const defaultMessage = message || ""; return ( <Modal transparent animationType={"none"} visible={loading} onRequestClose={modalClose} > <View style={styles.modalBackground}> <View style={styles.activityIndicatorWrapper}> <ActivityIndicator animating={loading} /> <Text style={styles.loadingText}>{defaultMessage}</Text> </View> </View> </Modal> ); } } @sergioutama
Why Similar but not the same It makes sense on
web or React to use functional stateless component It doesn't make sense on ReactNative Component make it easier to debug view hierarchy @sergioutama
Learn Native and its tools Not so easy way @sergioutama
ReactNative is not a crossplatform. It's not meant that way.
— Sergio Utama @sergioutama
Native Concept: Navigation, Containtment, Signing, Activty vs Fragments, Permission, etc
Tools: Xcode, Gradle, Fastlane @sergioutama
Q&A @sergioutama
The end? Thank you — @sergioutama @sergioutama