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
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Sergio Utama
July 12, 2018
Programming
280
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
69
Migrating to Swift 3
sergioutama
0
59
Taming AutoLayout
sergioutama
0
52
10 Things I learned while freelancing
sergioutama
0
61
iOS Video Player
sergioutama
0
96
Tribute to Mantle
sergioutama
0
35
Mobile Analytics
sergioutama
0
48
Other Decks in Programming
See All in Programming
Modding RubyKaigi for Myself
yui_knk
0
900
Swiftのレキシカルスコープ管理
kntkymt
0
210
Oxcを導入して開発体験が向上した話
yug1224
4
290
AIエージェントの隔離技術の徹底比較
kawayu
0
470
決定論的オーケストレーションの設計と実装 / Design and Implementation of Deterministic Orchestration
nrslib
3
1.1k
TAKTでAI駆動開発の品質を設計する
j5ik2o
6
1k
AI駆動開発で崩れていくコードベースを立て直す
kyoko_nr_nr
1
440
AI駆動開発勉強会 広島支部 第一回勉強会 AI駆動開発概要とワークショップ
hayatoshimiu
0
450
キャリア迷子上等 ─ "ない道"は自分で作ればいい
16bitidol
3
1.7k
The NotImplementedError Problem in Ruby
koic
1
620
AutonomyとControlのあいだ:Graflowで記述するAIエージェント協調
myui
0
110
TypeScript+Orvalで実現する型安全かつ堅牢でスケーラブルなマルチチャネル通知基盤 / TSKaigi Night talks ~after conference~
d0riven
0
300
Featured
See All Featured
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.3k
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
140
Building AI with AI
inesmontani
PRO
1
1.1k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.5k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.5k
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
280
Rebuilding a faster, lazier Slack
samanthasiow
85
9.5k
A Modern Web Designer's Workflow
chriscoyier
698
190k
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.3k
Balancing Empowerment & Direction
lara
6
1.1k
The Art of Programming - Codeland 2020
erikaheidi
57
14k
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
290
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