SlideShare uma empresa Scribd logo
1 de 63
Baixar para ler offline
DEVELOPING MOBILE APPS WITH
REACT NATIVE@ A LVA R O V I E B R A N T Z / / AV I E B R A N T Z . C O M . B R
1
• IT Analyst at Sefaz-MT
• Former Fullstack developer at
Procurix
• Bsc. Computer Science at UFMT
• Golang and React enthusiast
Cuiabá, MT, Brasil
alvarowolfx
@alvaroviebrantz
Alvaro Viebrantz
DevMT
R E A C T
W H A T I S R E A C T ?
5
R E A C T
Just the V of MVC
6
Created by Facebook 2013-2016
R E A C T
7
D ATA D O M
f(data) = View
One-way Data Flow
R E A C T
8
Simple and Declarative
JSX
R E A C T
9
JSX is a syntactic sugar
It’s just Javascript
R E A C T
Everything is a Component
10
R E A C T
Bring your own Architecture
11
R E A C T I N T E R N A L S
H O W R E A C T W O R K S ?
12
R E A C T I N T E R N A L S
13
Virtual DOM
R E A C T I N T E R N A L S
14
Batch Updates

Blazing Fast Diff Algorithm
R E A C T I N T E R N A L S
15
S TAT E
State vs Props
Mutable vs Immutable
What you Own vs What you Won
P R O P S
R E A C T I N T E R N A L S
• componentWillMount
• render
• componentDidMount
• shouldUpdateComponent
• componentWillUpdate
• render
• componentDidUpdate
• componentWillUnmount
M O U N T U P D AT E U N M O U N T
16
View lifecycle
R E A C T P U S H E D T H E W E B F O R WA R D
17
Many cutting edge web technologies
R E A C T P U S H E D T H E W E B F O R WA R D
18
Modern JS
Many projects using 

ES6 and ES7(!!!)
R E A C T P U S H E D T H E W E B F O R WA R D
19
More Functional Programming
in Javascript
Immutability
R E A C T P U S H E D T H E W E B F O R WA R D
• Awesome tooling and packaging
• Hot code reload
20
R E A C T P U S H E D T H E W E B F O R WA R D
Advanced application
architectures
21
R E A C T R E P E R C U S S I O N
• More Javascript oriented
• Components as a Tree
• Simpler Lifecycle
• One way data flow
• Functional Programming
22
R E A C T N AT I V E
W H A T I S R E A C T N A T I V E ?
23
I N A G I A N T S H O U L D E R ’ S
Why not apply this for
mobile development ?
24
W H Y N O T N AT I V E ?
• Native is hard
• Platform specific code
• Develop, Compile, Build, Test tedious lifecycle
• Hard to find developers
• Web developers are more easy to find
• But native it’s a necessary evil
25
A LT E R N AT I V E S T O N AT I V E
26
Hybrid apps with Cordova
A LT E R N AT I V E S T O N AT I V E
27
Many plugins (!!!)
Awesome frameworks
A LT E R N AT I V E S T O N AT I V E
28
S TAT E O F W E B V I E W S
“The State of JavaScript on Android in 2015 is… poor”
https://meta.discourse.org/t/the-state-of-javascript-on-android-in-2015-is-poor/33889/1
This is the benchmark most representative of Discourse performance, and the absolute best known Android score
for this benchmark is right at ~400ms on a Samsung Galaxy S6. That doesn't seem too bad until you compare..
iPhone 5 → 340ms
iPhone 5s → 175ms
iPhone 6 → 140ms
iPad Air 2 → 120ms
iPhone 6s → 60-70ms
29
R E A C T N AT I V E
• Created by Facebook
• Public release on early 2015
• Only iOS first
• Late 2015
• Android support
30
R E A C T N AT I V E A P P R O A C H
• Swap Virtual DOM and DOM Elements with:
• Native Views
• No web views !!!
31
R E A C T N AT I V E A P P R O A C H
Flexbox
CSS Subset
All implemented natively
32
R E A C T N AT I V E A P P R O A C H
Dedicated Gestures API
(PanResponder)
no more “fastclick”
33
R E A C T N AT I V E A P P R O A C H
Easy Animation API
Based on Facebook’s
Origami
34
R E A C T N AT I V E A P P R O A C H
Some Web Polyfills
Navigation, Timers, Fetch,
RAF looks exactly the same
35
N AT I V E A P P
R E A C T N AT I V E A P P R O A C H
Thin React to
Native Bridge
36
J AVA S C R I P T E N G I N E
B Y P L AT F O R M
R E A C T
J S
Y O U R A P P C O D E
R E A C T N AT I V E
J S L I B R A RY
N AT I V E A P P
R E A C T N AT I V E A P P R O A C H
37
J AVA S C R I P T E N G I N E
B Y P L AT F O R M
R E A C T
J S
Y O U R A P P C O D E
R E A C T N AT I V E
J S L I B R A RY
Y O U R N AT I V E A P P L I B
Y O U R J S
B R I D G E L I B
N a t i v e a p p
R E A C T N AT I V E A P P R O A C H
38
J a v a s c r i p t e n g i n e 

B y p l a t f o r m
Aw e s o m e B u t t o n . a n d ro i d . j s
A w e s o m e B u tt o n . j s
Aw e s o m e B u t t o n . i o s . j s
R E A C T N AT I V E E X T E N S I B I L I T Y
Native Modules and Views can be
marked as exported to be
accessed on the JS side
Must conform to Module or View
contract on each platform
39
R E A C T N AT I V E T O O L S
• ES 6
• FlowType (optional)
• Some ES 7
• async / await
• All backed by Babel
40
Inspector and Profiler
Live / Hot Module Reload
R E A C T N AT I V E T O O L S
41
R E A C T N AT I V E C O M P O N E N T S
		 ActivityIndicatorIOS

		 DatePickerIOS

		 DrawerLayoutAndroid

		 Image

		 ListView

		 MapView

		 Modal

		 Navigator

		 NavigatorIOS

		 PickerIOS

		 Picker

		 ProgressBarAndroid

		 ProgressViewIOS

		 RefreshControl

		 ScrollView

		 SegmentedControlIOS

		 SliderIOS

		 StatusBar

		 Switch

		 TabBarIOS

		 TabBarIOS.Item

		 Text

		 TextInput

		 ToolbarAndroid

		 TouchableHighlight

		 TouchableNativeFeedback

		 TouchableOpacity

		 TouchableWithoutFeedback

		 View

		 ViewPagerAndroid

		 WebView
42
R E A C T N AT I V E C O M P O N E N T S
43
	

		 ListView

		 MapView

		 Navigator

		 ScrollView

		 Text

		 TextInput

		 View

		 WebView
R E A C T N AT I V E A P I S
		 ActionSheetIOS

		 Alert

		 AlertIOS

		 Animated

		 AppRegistry

		 AppStateIOS

		 AppState

		 AsyncStorage

		 BackAndroid

		 CameraRoll

		 Clipboard

		 DatePickerAndroid

		 Dimensions

		 IntentAndroid

		 InteractionManager

		 LayoutAnimation

		 Linking

		 LinkingIOS

		 NativeMethodsMixin

		 NetInfo

		 PanResponder

		 PixelRatio

		 PushNotificationIOS

		 StatusBarIOS

		 StyleSheet

		 TimePickerAndroid

		 ToastAndroid

		 VibrationIOS

		 Vibration
44
R E A C T N AT I V E E C O S Y S T E M45
R E A C T N AT I V E A D O P T I O N
28.000+ 30.000 Github stars
Backed by Facebook
Version 0.21 0.24-rc
Fast iterations
46
PA C K A G E S A N D C O M P O N E N T S
https://js.coach
47
C O D E P U S H
microsoft.github.io/code-push/
48
49
50
R E A C T N AT I V E O N W I N D O W S
51
https://blogs.windows.com/buildingapps/2016/04/13/react-native-on-the-universal-windows-platform/
S H O W C A S E
F 8 C O N F E R E N C E A P P
52
https://github.com/
fbsamples/f8app
S H O W C A S E
53
C H E C K I T O U T
• Install NodeJS and NPM
• Install React Native command line tools

• For iOS development
• Only on Mac and only need Xcode
• For android dev
• Install Android SDK and Genymotion (recommended)
> npm install -g react-native-cli
54
C H E C K I T O U T
• Then just create a project with





• To run the iOS project
• To run the Android project
> react-native init AwesomeProject
> react-native run-ios
> react-native run-android
55
56
DEMO
May the demo gods be with us
G I F PA R T Y
57
G I F PA R T Y
58
• Giphy API
• Redux Architecture
• Navigation + ListView + CustomComponents
• Tests with Chai + Mocha
• All available on

github.com/alvarowolfx/GifPartyReactNative
G I F PA R T Y
59
Let’s Organize the party
Let’s Animate the party
Let’s Make Our Own party
G I F PA R T Y
60
W H O ’ S G O N N A W I N ?
61
W H O ’ S G O N N A W I N ?
R E A C T N AT I V E I O N I C & C O R D O VA
P E R F O R M A N C E V E RY G O O D G O O D
N AT I V E M O D U L E S G O O D G O O D
S TA R T P R O J E C T V E RY G O O D P O O R
LT S U P P O R T C U T T I N G E D G E V E RY G O O D
C O M M U N I T Y P O O R V E RY G O O D
E C O S Y S T E M P O O R V E RY G O O D
B A C K E D B Y FA C E B O O K G O O G L E A N D I O N I C
D E B U G G E R & P R O F I L E R V E RY G O O D P O O R
D E V T O O L S G O O D G O O D
62
T H AT ’ S A L L F O L K S
63
DEVELOPING MOBILE APPS WITH
REACT NATIVE

Mais conteúdo relacionado

Mais procurados

Mais procurados (20)

Introduction to React Native
Introduction to React NativeIntroduction to React Native
Introduction to React Native
 
React Native Workshop
React Native WorkshopReact Native Workshop
React Native Workshop
 
React Native
React NativeReact Native
React Native
 
Native, Web or Hybrid Mobile App Development?
Native, Web or Hybrid Mobile App Development?Native, Web or Hybrid Mobile App Development?
Native, Web or Hybrid Mobile App Development?
 
React-JS.pptx
React-JS.pptxReact-JS.pptx
React-JS.pptx
 
Intro to react native
Intro to react nativeIntro to react native
Intro to react native
 
React native
React nativeReact native
React native
 
React native development with expo
React native development with expoReact native development with expo
React native development with expo
 
React Native
React NativeReact Native
React Native
 
Introduction to Flutter.pptx
Introduction to Flutter.pptxIntroduction to Flutter.pptx
Introduction to Flutter.pptx
 
Introduction to ReactJS
Introduction to ReactJSIntroduction to ReactJS
Introduction to ReactJS
 
Node.js Basics
Node.js Basics Node.js Basics
Node.js Basics
 
Introduction to React JS
Introduction to React JSIntroduction to React JS
Introduction to React JS
 
Intro to React
Intro to ReactIntro to React
Intro to React
 
Flutter talkshow
Flutter talkshowFlutter talkshow
Flutter talkshow
 
React + Redux Introduction
React + Redux IntroductionReact + Redux Introduction
React + Redux Introduction
 
Introduction to React JS for beginners | Namespace IT
Introduction to React JS for beginners | Namespace ITIntroduction to React JS for beginners | Namespace IT
Introduction to React JS for beginners | Namespace IT
 
Redux toolkit
Redux toolkitRedux toolkit
Redux toolkit
 
React workshop presentation
React workshop presentationReact workshop presentation
React workshop presentation
 
Introduction to React Native Workshop
Introduction to React Native WorkshopIntroduction to React Native Workshop
Introduction to React Native Workshop
 

Destaque

React.js - and how it changed our thinking about UI
React.js - and how it changed our thinking about UIReact.js - and how it changed our thinking about UI
React.js - and how it changed our thinking about UI
Marcin Grzywaczewski
 

Destaque (15)

React Native
React NativeReact Native
React Native
 
React native - What, Why, How?
React native - What, Why, How?React native - What, Why, How?
React native - What, Why, How?
 
A tour of React Native
A tour of React NativeA tour of React Native
A tour of React Native
 
React Native 入門
React Native 入門React Native 入門
React Native 入門
 
Getting Started with React Native (and should I use it at all?)
Getting Started with React Native (and should I use it at all?)Getting Started with React Native (and should I use it at all?)
Getting Started with React Native (and should I use it at all?)
 
React Native custom components
React Native custom componentsReact Native custom components
React Native custom components
 
Milano JS Meetup - Gabriele Petronella - Codemotion Milan 2016
Milano JS Meetup -  Gabriele Petronella - Codemotion Milan 2016Milano JS Meetup -  Gabriele Petronella - Codemotion Milan 2016
Milano JS Meetup - Gabriele Petronella - Codemotion Milan 2016
 
Article 5 Suffrage
Article 5 SuffrageArticle 5 Suffrage
Article 5 Suffrage
 
React Native Introduction: Making Real iOS and Android Mobile App By JavaScript
React Native Introduction: Making Real iOS and Android Mobile App By JavaScriptReact Native Introduction: Making Real iOS and Android Mobile App By JavaScript
React Native Introduction: Making Real iOS and Android Mobile App By JavaScript
 
React.js - and how it changed our thinking about UI
React.js - and how it changed our thinking about UIReact.js - and how it changed our thinking about UI
React.js - and how it changed our thinking about UI
 
Article IV Citizenship
Article IV CitizenshipArticle IV Citizenship
Article IV Citizenship
 
Philippine Constitution 1987 (Article 3 - Bill of Rights)
Philippine Constitution 1987 (Article 3 - Bill of Rights)Philippine Constitution 1987 (Article 3 - Bill of Rights)
Philippine Constitution 1987 (Article 3 - Bill of Rights)
 
Summary Bill or RIGHTS Article 3 Section 1-22
Summary Bill or RIGHTS Article 3 Section 1-22Summary Bill or RIGHTS Article 3 Section 1-22
Summary Bill or RIGHTS Article 3 Section 1-22
 
Concept of Bill of Rights (Philippines)
Concept of Bill of Rights (Philippines)Concept of Bill of Rights (Philippines)
Concept of Bill of Rights (Philippines)
 
[React Native Tutorial] Lecture 6: Component, Props, and Network
[React Native Tutorial] Lecture 6: Component, Props, and Network[React Native Tutorial] Lecture 6: Component, Props, and Network
[React Native Tutorial] Lecture 6: Component, Props, and Network
 

Semelhante a Developing Apps With React Native

SharePoint Saturday Redmond - Building solutions with the future in mind
SharePoint Saturday Redmond - Building solutions with the future in mindSharePoint Saturday Redmond - Building solutions with the future in mind
SharePoint Saturday Redmond - Building solutions with the future in mind
Chris Johnson
 
From Content Strategy to Drupal Site Building - Connecting the dots
From Content Strategy to Drupal Site Building - Connecting the dotsFrom Content Strategy to Drupal Site Building - Connecting the dots
From Content Strategy to Drupal Site Building - Connecting the dots
Ronald Ashri
 
From Content Strategy to Drupal Site Building - Connecting the Dots
From Content Strategy to Drupal Site Building - Connecting the DotsFrom Content Strategy to Drupal Site Building - Connecting the Dots
From Content Strategy to Drupal Site Building - Connecting the Dots
Ronald Ashri
 

Semelhante a Developing Apps With React Native (20)

React native first impression
React native first impressionReact native first impression
React native first impression
 
Guia do desenvolvedor mobile das galáxias
Guia do desenvolvedor mobile das galáxiasGuia do desenvolvedor mobile das galáxias
Guia do desenvolvedor mobile das galáxias
 
SharePoint Saturday Redmond - Building solutions with the future in mind
SharePoint Saturday Redmond - Building solutions with the future in mindSharePoint Saturday Redmond - Building solutions with the future in mind
SharePoint Saturday Redmond - Building solutions with the future in mind
 
Angular server side rendering with NodeJS - In Pursuit Of Speed
Angular server side rendering with NodeJS - In Pursuit Of SpeedAngular server side rendering with NodeJS - In Pursuit Of Speed
Angular server side rendering with NodeJS - In Pursuit Of Speed
 
The Expanding Boundaries of CSS
The Expanding Boundaries of CSSThe Expanding Boundaries of CSS
The Expanding Boundaries of CSS
 
Strangler Pattern in practice @PHPers Day 2019
Strangler Pattern in practice @PHPers Day 2019Strangler Pattern in practice @PHPers Day 2019
Strangler Pattern in practice @PHPers Day 2019
 
Developers in the New Age of the Web
Developers in the New Age of the WebDevelopers in the New Age of the Web
Developers in the New Age of the Web
 
Developers in the New Age of the Web
Developers in the New Age of the WebDevelopers in the New Age of the Web
Developers in the New Age of the Web
 
From Content Strategy to Drupal Site Building - Connecting the dots
From Content Strategy to Drupal Site Building - Connecting the dotsFrom Content Strategy to Drupal Site Building - Connecting the dots
From Content Strategy to Drupal Site Building - Connecting the dots
 
From Content Strategy to Drupal Site Building - Connecting the Dots
From Content Strategy to Drupal Site Building - Connecting the DotsFrom Content Strategy to Drupal Site Building - Connecting the Dots
From Content Strategy to Drupal Site Building - Connecting the Dots
 
Data Modelling at Scale
Data Modelling at ScaleData Modelling at Scale
Data Modelling at Scale
 
Choosing the right database
Choosing the right databaseChoosing the right database
Choosing the right database
 
Web Development for Managers
Web Development for ManagersWeb Development for Managers
Web Development for Managers
 
Architecting your IT career
Architecting your IT careerArchitecting your IT career
Architecting your IT career
 
Meteor WWNRW Intro
Meteor WWNRW IntroMeteor WWNRW Intro
Meteor WWNRW Intro
 
Java 20
Java 20Java 20
Java 20
 
JavaFX Enterprise
JavaFX EnterpriseJavaFX Enterprise
JavaFX Enterprise
 
The Road to QA
The Road to QAThe Road to QA
The Road to QA
 
Design for Startups
Design for StartupsDesign for Startups
Design for Startups
 
Switching horses midstream - From Waterfall to Agile
Switching horses midstream - From Waterfall to AgileSwitching horses midstream - From Waterfall to Agile
Switching horses midstream - From Waterfall to Agile
 

Mais de Alvaro Viebrantz

Ambiente de CI/CD com Google Cloud
Ambiente de CI/CD com Google CloudAmbiente de CI/CD com Google Cloud
Ambiente de CI/CD com Google Cloud
Alvaro Viebrantz
 

Mais de Alvaro Viebrantz (20)

BigQuery Performance Improvements Storage API
BigQuery Performance Improvements Storage APIBigQuery Performance Improvements Storage API
BigQuery Performance Improvements Storage API
 
End to End IoT projects with Zephyr.pdf
End to End IoT projects with Zephyr.pdfEnd to End IoT projects with Zephyr.pdf
End to End IoT projects with Zephyr.pdf
 
Carreira de Desenvolvimento
Carreira de DesenvolvimentoCarreira de Desenvolvimento
Carreira de Desenvolvimento
 
Construindo aplicações Cloud Native em Go
Construindo aplicações Cloud Native em GoConstruindo aplicações Cloud Native em Go
Construindo aplicações Cloud Native em Go
 
Prototipação em hackathons
Prototipação em hackathonsPrototipação em hackathons
Prototipação em hackathons
 
Building REST APIs using gRPC and Go
Building REST APIs using gRPC and GoBuilding REST APIs using gRPC and Go
Building REST APIs using gRPC and Go
 
TinyML - IoT e Machine Learning
TinyML -  IoT e Machine LearningTinyML -  IoT e Machine Learning
TinyML - IoT e Machine Learning
 
O que projetos de IoT precisam ?
O que projetos de IoT precisam ?O que projetos de IoT precisam ?
O que projetos de IoT precisam ?
 
Ambiente de CI/CD com Google Cloud
Ambiente de CI/CD com Google CloudAmbiente de CI/CD com Google Cloud
Ambiente de CI/CD com Google Cloud
 
Big Query - Escalabilidade Infinita para os seus Dados
Big Query  - Escalabilidade Infinita para os seus DadosBig Query  - Escalabilidade Infinita para os seus Dados
Big Query - Escalabilidade Infinita para os seus Dados
 
Rodando uma API Com Django Rest Framework no Google Cloud
Rodando uma API Com Django Rest Framework  no Google CloudRodando uma API Com Django Rest Framework  no Google Cloud
Rodando uma API Com Django Rest Framework no Google Cloud
 
Edge computing na prática com IoT, Machine Learning e Google Cloud
Edge computing na prática com IoT, Machine Learning e Google CloudEdge computing na prática com IoT, Machine Learning e Google Cloud
Edge computing na prática com IoT, Machine Learning e Google Cloud
 
Edge computing in practice using IoT, Tensorflow and Google Cloud
Edge computing in practice using IoT, Tensorflow and Google CloudEdge computing in practice using IoT, Tensorflow and Google Cloud
Edge computing in practice using IoT, Tensorflow and Google Cloud
 
Iniciando com LoRa, The Things Network e Google Cloud
Iniciando com LoRa, The Things Network e Google CloudIniciando com LoRa, The Things Network e Google Cloud
Iniciando com LoRa, The Things Network e Google Cloud
 
Construindo projetos para o Google Assistant - I/O 2019 Recap São Paulo
Construindo projetos para o Google Assistant - I/O 2019 Recap São PauloConstruindo projetos para o Google Assistant - I/O 2019 Recap São Paulo
Construindo projetos para o Google Assistant - I/O 2019 Recap São Paulo
 
Edge computing na prática com IoT, Machine Learning e Google Cloud
Edge computing na prática com IoT, Machine Learning e Google CloudEdge computing na prática com IoT, Machine Learning e Google Cloud
Edge computing na prática com IoT, Machine Learning e Google Cloud
 
Construindo projetos com Google Assistant e IoT
Construindo projetos com Google Assistant e IoTConstruindo projetos com Google Assistant e IoT
Construindo projetos com Google Assistant e IoT
 
Explorando Go em Ambiente Embarcado
Explorando Go em Ambiente EmbarcadoExplorando Go em Ambiente Embarcado
Explorando Go em Ambiente Embarcado
 
Soluções de IoT usando Arduino e Google Cloud
Soluções de IoT usando Arduino e Google CloudSoluções de IoT usando Arduino e Google Cloud
Soluções de IoT usando Arduino e Google Cloud
 
Soluções de IoT usando Google Cloud e Firebase
Soluções de IoT usando Google Cloud e FirebaseSoluções de IoT usando Google Cloud e Firebase
Soluções de IoT usando Google Cloud e Firebase
 

Último

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Último (20)

Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 

Developing Apps With React Native

  • 1. DEVELOPING MOBILE APPS WITH REACT NATIVE@ A LVA R O V I E B R A N T Z / / AV I E B R A N T Z . C O M . B R 1
  • 2. • IT Analyst at Sefaz-MT • Former Fullstack developer at Procurix • Bsc. Computer Science at UFMT • Golang and React enthusiast Cuiabá, MT, Brasil alvarowolfx @alvaroviebrantz Alvaro Viebrantz
  • 3.
  • 5. R E A C T W H A T I S R E A C T ? 5
  • 6. R E A C T Just the V of MVC 6 Created by Facebook 2013-2016
  • 7. R E A C T 7 D ATA D O M f(data) = View One-way Data Flow
  • 8. R E A C T 8 Simple and Declarative JSX
  • 9. R E A C T 9 JSX is a syntactic sugar It’s just Javascript
  • 10. R E A C T Everything is a Component 10
  • 11. R E A C T Bring your own Architecture 11
  • 12. R E A C T I N T E R N A L S H O W R E A C T W O R K S ? 12
  • 13. R E A C T I N T E R N A L S 13 Virtual DOM
  • 14. R E A C T I N T E R N A L S 14 Batch Updates
 Blazing Fast Diff Algorithm
  • 15. R E A C T I N T E R N A L S 15 S TAT E State vs Props Mutable vs Immutable What you Own vs What you Won P R O P S
  • 16. R E A C T I N T E R N A L S • componentWillMount • render • componentDidMount • shouldUpdateComponent • componentWillUpdate • render • componentDidUpdate • componentWillUnmount M O U N T U P D AT E U N M O U N T 16 View lifecycle
  • 17. R E A C T P U S H E D T H E W E B F O R WA R D 17 Many cutting edge web technologies
  • 18. R E A C T P U S H E D T H E W E B F O R WA R D 18 Modern JS Many projects using 
 ES6 and ES7(!!!)
  • 19. R E A C T P U S H E D T H E W E B F O R WA R D 19 More Functional Programming in Javascript Immutability
  • 20. R E A C T P U S H E D T H E W E B F O R WA R D • Awesome tooling and packaging • Hot code reload 20
  • 21. R E A C T P U S H E D T H E W E B F O R WA R D Advanced application architectures 21
  • 22. R E A C T R E P E R C U S S I O N • More Javascript oriented • Components as a Tree • Simpler Lifecycle • One way data flow • Functional Programming 22
  • 23. R E A C T N AT I V E W H A T I S R E A C T N A T I V E ? 23
  • 24. I N A G I A N T S H O U L D E R ’ S Why not apply this for mobile development ? 24
  • 25. W H Y N O T N AT I V E ? • Native is hard • Platform specific code • Develop, Compile, Build, Test tedious lifecycle • Hard to find developers • Web developers are more easy to find • But native it’s a necessary evil 25
  • 26. A LT E R N AT I V E S T O N AT I V E 26 Hybrid apps with Cordova
  • 27. A LT E R N AT I V E S T O N AT I V E 27 Many plugins (!!!) Awesome frameworks
  • 28. A LT E R N AT I V E S T O N AT I V E 28
  • 29. S TAT E O F W E B V I E W S “The State of JavaScript on Android in 2015 is… poor” https://meta.discourse.org/t/the-state-of-javascript-on-android-in-2015-is-poor/33889/1 This is the benchmark most representative of Discourse performance, and the absolute best known Android score for this benchmark is right at ~400ms on a Samsung Galaxy S6. That doesn't seem too bad until you compare.. iPhone 5 → 340ms iPhone 5s → 175ms iPhone 6 → 140ms iPad Air 2 → 120ms iPhone 6s → 60-70ms 29
  • 30. R E A C T N AT I V E • Created by Facebook • Public release on early 2015 • Only iOS first • Late 2015 • Android support 30
  • 31. R E A C T N AT I V E A P P R O A C H • Swap Virtual DOM and DOM Elements with: • Native Views • No web views !!! 31
  • 32. R E A C T N AT I V E A P P R O A C H Flexbox CSS Subset All implemented natively 32
  • 33. R E A C T N AT I V E A P P R O A C H Dedicated Gestures API (PanResponder) no more “fastclick” 33
  • 34. R E A C T N AT I V E A P P R O A C H Easy Animation API Based on Facebook’s Origami 34
  • 35. R E A C T N AT I V E A P P R O A C H Some Web Polyfills Navigation, Timers, Fetch, RAF looks exactly the same 35
  • 36. N AT I V E A P P R E A C T N AT I V E A P P R O A C H Thin React to Native Bridge 36 J AVA S C R I P T E N G I N E B Y P L AT F O R M R E A C T J S Y O U R A P P C O D E R E A C T N AT I V E J S L I B R A RY
  • 37. N AT I V E A P P R E A C T N AT I V E A P P R O A C H 37 J AVA S C R I P T E N G I N E B Y P L AT F O R M R E A C T J S Y O U R A P P C O D E R E A C T N AT I V E J S L I B R A RY Y O U R N AT I V E A P P L I B Y O U R J S B R I D G E L I B
  • 38. N a t i v e a p p R E A C T N AT I V E A P P R O A C H 38 J a v a s c r i p t e n g i n e B y p l a t f o r m Aw e s o m e B u t t o n . a n d ro i d . j s A w e s o m e B u tt o n . j s Aw e s o m e B u t t o n . i o s . j s
  • 39. R E A C T N AT I V E E X T E N S I B I L I T Y Native Modules and Views can be marked as exported to be accessed on the JS side Must conform to Module or View contract on each platform 39
  • 40. R E A C T N AT I V E T O O L S • ES 6 • FlowType (optional) • Some ES 7 • async / await • All backed by Babel 40
  • 41. Inspector and Profiler Live / Hot Module Reload R E A C T N AT I V E T O O L S 41
  • 42. R E A C T N AT I V E C O M P O N E N T S ActivityIndicatorIOS DatePickerIOS DrawerLayoutAndroid Image ListView MapView Modal Navigator NavigatorIOS PickerIOS Picker ProgressBarAndroid ProgressViewIOS RefreshControl ScrollView SegmentedControlIOS SliderIOS StatusBar Switch TabBarIOS TabBarIOS.Item Text TextInput ToolbarAndroid TouchableHighlight TouchableNativeFeedback TouchableOpacity TouchableWithoutFeedback View ViewPagerAndroid WebView 42
  • 43. R E A C T N AT I V E C O M P O N E N T S 43 ListView MapView Navigator ScrollView Text TextInput View WebView
  • 44. R E A C T N AT I V E A P I S ActionSheetIOS Alert AlertIOS Animated AppRegistry AppStateIOS AppState AsyncStorage BackAndroid CameraRoll Clipboard DatePickerAndroid Dimensions IntentAndroid InteractionManager LayoutAnimation Linking LinkingIOS NativeMethodsMixin NetInfo PanResponder PixelRatio PushNotificationIOS StatusBarIOS StyleSheet TimePickerAndroid ToastAndroid VibrationIOS Vibration 44
  • 45. R E A C T N AT I V E E C O S Y S T E M45
  • 46. R E A C T N AT I V E A D O P T I O N 28.000+ 30.000 Github stars Backed by Facebook Version 0.21 0.24-rc Fast iterations 46
  • 47. PA C K A G E S A N D C O M P O N E N T S https://js.coach 47
  • 48. C O D E P U S H microsoft.github.io/code-push/ 48
  • 49. 49
  • 50. 50
  • 51. R E A C T N AT I V E O N W I N D O W S 51 https://blogs.windows.com/buildingapps/2016/04/13/react-native-on-the-universal-windows-platform/
  • 52. S H O W C A S E F 8 C O N F E R E N C E A P P 52 https://github.com/ fbsamples/f8app
  • 53. S H O W C A S E 53
  • 54. C H E C K I T O U T • Install NodeJS and NPM • Install React Native command line tools
 • For iOS development • Only on Mac and only need Xcode • For android dev • Install Android SDK and Genymotion (recommended) > npm install -g react-native-cli 54
  • 55. C H E C K I T O U T • Then just create a project with
 
 
 • To run the iOS project • To run the Android project > react-native init AwesomeProject > react-native run-ios > react-native run-android 55
  • 56. 56 DEMO May the demo gods be with us
  • 57. G I F PA R T Y 57
  • 58. G I F PA R T Y 58 • Giphy API • Redux Architecture • Navigation + ListView + CustomComponents • Tests with Chai + Mocha • All available on
 github.com/alvarowolfx/GifPartyReactNative
  • 59. G I F PA R T Y 59 Let’s Organize the party Let’s Animate the party Let’s Make Our Own party
  • 60. G I F PA R T Y 60
  • 61. W H O ’ S G O N N A W I N ? 61
  • 62. W H O ’ S G O N N A W I N ? R E A C T N AT I V E I O N I C & C O R D O VA P E R F O R M A N C E V E RY G O O D G O O D N AT I V E M O D U L E S G O O D G O O D S TA R T P R O J E C T V E RY G O O D P O O R LT S U P P O R T C U T T I N G E D G E V E RY G O O D C O M M U N I T Y P O O R V E RY G O O D E C O S Y S T E M P O O R V E RY G O O D B A C K E D B Y FA C E B O O K G O O G L E A N D I O N I C D E B U G G E R & P R O F I L E R V E RY G O O D P O O R D E V T O O L S G O O D G O O D 62
  • 63. T H AT ’ S A L L F O L K S 63 DEVELOPING MOBILE APPS WITH REACT NATIVE