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
Easy Way to Improve ReactNative
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Sergio Utama
July 12, 2018
Programming
270
0
Share
Easy Way to Improve ReactNative
5 easy way to improve ReactNative project
Sergio Utama
July 12, 2018
More Decks by Sergio Utama
See All by Sergio Utama
From try! Swift Tokyo 2017
sergioutama
0
65
Migrating to Swift 3
sergioutama
0
58
Taming AutoLayout
sergioutama
0
50
10 Things I learned while freelancing
sergioutama
0
60
iOS Video Player
sergioutama
0
93
Tribute to Mantle
sergioutama
0
32
Mobile Analytics
sergioutama
0
47
Other Decks in Programming
See All in Programming
Surviving Black Friday: 329 billion requests with Falcon!
ioquatix
0
2.9k
Claude CodeでETLジョブ実行テストを自動化してみた
yoshikikasama
0
1.2k
AI時代のエンジニアリングの原則 / Engineering Principles in the AI Era
haru860
0
1.1k
How We Practice Exploratory Testing in Iterative Development( #scrumniigata ) / 反復開発の中で、探索的テストをどう実施しているか
teyamagu
PRO
3
750
「OSSがあるなら自作するな」は AI時代も正しいか ── Build vs Adopt の新しい判断基準
kumorn5s
7
2.2k
〜バイブコーディングを超えて〜 チームで実験し続けたAI駆動開発
tigertora7571
0
200
PicoRuby for IoT: Connecting to the Cloud with MQTT
yuuu
2
770
AlarmKitで明後日起きれるアラームアプリを作る
trickart
0
120
なぜあなたのコードには「コシ」がないのか?〜AI時代に問う、最後まで美味しい設計と戦略〜 #phpconkagawa / phpconkagawa2026
shogogg
0
150
Are We Really Coding 10× Faster with AI?
kohzas
0
130
GitHubCopilotCLIをはじめよう.pdf
htkym
0
330
tRPCの概要と少しだけパフォーマンス
misoton665
2
270
Featured
See All Featured
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.7k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.3k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.8k
Designing Experiences People Love
moore
143
24k
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
780
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
Are puppies a ranking factor?
jonoalderson
1
3.4k
The untapped power of vector embeddings
frankvandijk
2
1.7k
What does AI have to do with Human Rights?
axbom
PRO
1
2.1k
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
0
230
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
350
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
450
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