Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
React Native Architecture in 2021
Search
Akinn Rosa
October 16, 2021
Technology
0
220
React Native Architecture in 2021
Slides for talk about React Native Re-architecture on React Conf Brazil 2021
Akinn Rosa
October 16, 2021
Tweet
Share
More Decks by Akinn Rosa
See All by Akinn Rosa
Over-The-Air Updates in React Native
akinncar
0
16
React Native Universal Apps
akinncar
0
5
Aplicativo Móvel para gestão de fidelidade de clientes
akinncar
0
24
Developing 3D multiplatform games with three.js in React Native
akinncar
0
120
Other Decks in Technology
See All in Technology
寫了幾年 Code,然後呢?軟體工程師必須重新認識的 DevOps
cheng_wei_chen
1
530
小さな判断で育つ、大きな意思決定力 / 20251204 Takahiro Kinjo
shift_evolve
PRO
1
570
因果AIへの招待
sshimizu2006
0
920
AI 駆動開発勉強会 フロントエンド支部 #1 w/あずもば
1ftseabass
PRO
0
130
20251209_WAKECareer_生成AIを活用した設計・開発プロセス
syobochim
5
1.3k
21st ACRi Webinar - Univ of Tokyo Presentation Slide (Ayumi Ohno)
nao_sumikawa
0
120
Debugging Edge AI on Zephyr and Lessons Learned
iotengineer22
0
110
プロダクトマネージャーが押さえておくべき、ソフトウェア資産とAIエージェント投資効果 / pmconf2025
i35_267
2
580
eBPFとwaruiBPF
sat
PRO
4
2.5k
コミューンのデータ分析AIエージェント「Community Sage」の紹介
fufufukakaka
0
430
意外とあった SQL Server 関連アップデート + Database Savings Plans
stknohg
PRO
0
290
Playwright x GitHub Actionsで実現する「レビューしやすい」E2Eテストレポート
kinosuke01
0
320
Featured
See All Featured
Speed Design
sergeychernyshev
33
1.4k
Why Our Code Smells
bkeepers
PRO
340
57k
Bash Introduction
62gerente
615
210k
Art, The Web, and Tiny UX
lynnandtonic
303
21k
How to Ace a Technical Interview
jacobian
280
24k
Context Engineering - Making Every Token Count
addyosmani
9
490
Statistics for Hackers
jakevdp
799
230k
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
How To Stay Up To Date on Web Technology
chriscoyier
791
250k
For a Future-Friendly Web
brad_frost
180
10k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
285
14k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.3k
Transcript
React Native Architecture in 2021 Akinn Rosa
Akinn Rosa @akinncar @akinncar Fullstack Developer
Overview
Current Architecture
React "Native"
Native Component
Native Component: Color View ColorViewManager.java
Native Component: Color View ColorPackage.java lic class ColorPackage implements ReactPackage
{ @Override public List<NativeModule> createNativeModules(ReactApplicationContext reactContext return Collections.emptyList(); } @Override public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) return Arrays.<ViewManager>asList(new ColorViewManager()); }
Native Component: Color View App.js import { requireNativeComponent } from
'react-native'; export const ColorView = requireNativeComponent('ColorView'); export default function App() { return ( <View style={{ flex: 1 }}> <ColorView color="#32a852" style={{ flex: 1 }} /> </View> ); }
Native Module
Native Module: Sum SumModule.java
Native Module: Sum ColorPackage.java lass SumPackage implements ReactPackage { rride
ic List<NativeModule> createNativeModules(@NonNull ReactApplicationContext reactCo List<NativeModule> modules = new ArrayList<>(); modules.add(new SumModule(reactContext)); return modules; rride ic List<ViewManager> createViewManagers(@NonNull ReactApplicationContext reactCont return Collections.emptyList();
Native Module: Sum App.js import { NativeModules } from 'react-native';
const { SumModule } = NativeModules; export default function App() { return ( <View style={{ flex: 1 }}> <Text>Result: {SumModule.sum(2, 2)}</Text> </View> ); }
Threads
Threads
Threads
Threads
Threads
Threads
Problems
Current ScrollView
Turbo Modules Is the new generation of React Native Modules.
It aims to work with native functions like browsers, exposing native functions using JSI and improving module performances.
Browser Native Function
Javascript Interface (JSI) JSI is an engine-independent API to interact
with Javascript from C++. It allows to call functions and hold references on these two languages, without the need for any serialization.
Sum Module Header (Objective-C++) Sum.h #import <React/RCTBridgeModule.h> #import "react-native-sum.h" @interface
Sum : NSObject <RCTBridgeModule> @property (nonatomic, assign) BOOL setBridgeOnMainQueue; @end
Sum Module (Objective-C++) Sum.mm
Sum Module Header (C++) react-native-sum.h #include <jsi/jsilib.h> #include <jsi/jsi.h> void
installSum(facebook::jsi::Runtime& jsiRuntime);
Sum Module (C++) react-native-sum.cpp
Sum Module (Javascript) App.js export default function App() { return
( <View style={{ flex: 1 }}> <Text>Result: {global.sum(2, 2)}</Text> </View> ); }
Libraries implemented using JSI react-native-reanimated react-native-vision-camera react-native-mmkv react-native-quick-sqlite
Fabric Is the new React Native renderer. With Fabric, the
UI operations are exposed to Javascript with JSI. This new UI can create and update native components passing information without using the bridge.
Current Architecture
New Architecture
New Architecture + Codegen
Codegen (react-native-codegen) Automation to compatibility JS and Native code. It's
a generator that will define your classes and functions in C++ base on types with Typescript and Flow, to avoid data validation every time.
What should I do?
What's next?
References The New React Native Architecture Explained David Vacca -
The state of React Native Parashuram N - React Native's New Architecture Emily Janzer - The New React Native React-native JSI module React Native JSI: Part 1 - Getting Started Bringing the Fabric renderer to the “Facebook” app React Native in H2
Be my Patreon: https://www.patreon.com/akinncar
Thanks! @akinncar @akinncar