SlideShare a Scribd company logo
Andy Dyer
@dammitandy
React Native:
Is It Worth It?
React Native: Is It Worth It? UA Mobile 2017.
React Native: Is It Worth It? UA Mobile 2017.
WHY REACT NATIVE?
Fast iteration
Cross-platform
Learning something new
React Architecture
Sample App
1. import React, { Component } from 'react';
2. import {
3. AppRegistry,
4. StyleSheet,
5. Text,
6. TextInput,
7. View
Run it: https://goo.gl/h5g2eg
INTEGRATION WITH EXISTING APPS
1. Create package.json and run yarn to
fetch dependencies
2. Add project from node_modules/ to
settings.gradle
3. Add dependency to build.gradle
4. Add Activity to load JS component
5. Run yarn start to bundle JS and
launch Activity
React Native: Is It Worth It? UA Mobile 2017.
React Native: Is It Worth It? UA Mobile 2017.
What was the problem?
DIFFERENT OKHTTP VERSIONS
React Native 0.45 was using OkHttp 3.4
Our app was using a newer version
Breaking changes between versions
"Upgrade to OkHttp 3.8.0" PR
Discussion
"Upgrade to OkHttp 3.8.0" PR
Discussion
React Native: Is It Worth It? UA Mobile 2017.
We're Not Done Yet...
React Native: Is It Worth It? UA Mobile 2017.
...you lose the patent
license...if you sue us
for patent
infringement.
- Explaining React's License
https://code.facebook.com/posts/112130496157735/explainin
react-s-license/
React Native: Is It Worth It? UA Mobile 2017.
...the Gutenberg
team is going
to...rewrite
Gutenberg using a
different library.
- On React and WordPress
https://ma.tt/2017/09/on-react-and-wordpress/
React Native Consideration #1
It’s a big dependency and may
limit your ability to upgrade
other libraries.
DEVELOPING WITH REACT NATIVE
Your favorite text editor
Chrome Developer Tools
More typing...but much less checking
Twitter while waiting for builds
Java is to JavaScript as Car is to Carpet
Use TypeScript or Flow
Con gure a linter
Con gure Prettier to auto format on
save
TypeScript
NOT-SO-GREAT THINGS
Handling orientation changes
android:configChanges="keyboard
|keyboardHidden|orientation|screenSiz
or lock to portrait
Third party libraries required for
standard things like Material Design and
i8ln
Interop with native code requires extra
classes
React Native Consideration #2
It’s way different than normal
Android development.
Don't Drive Too Fast
TESTING REACT NATIVE APPS
Jest - Snapshot testing
Detox - Espresso like UI testing
Enzyme - Robolectric like UI testing
CROSS-PLATFORM THAT DOESN'T SUCK
Best practices are still evolving.
How much to share? What is okay to
duplicate?
Stick to native code where you need it.
Android code
1. if (Platform.OS === 'android') {
2. alert('Android');
3. } else {
4. alert('iOS');
5. }
FILE NAME CONVENTION
Android iOS
index.android.js index.ios.js
React Native Consideration #3
Clean and maintainable cross-
platform code requires the
commitment of everyone on the
team.
APP UPDATES WITH CODEPUSH
"According to section 3.3.2 of Apple’s
developer agreement, as long as you are
using the CodePush service to release bug
xes and improvements/features that
maintain the app’s original/presented
purpose (i.e. don’t CodePush a calculator
into a rst-person shooter), then you will
be ne, and your users will be happy."
APP UPDATES WITH CODEPUSH
"Because Cordova apps are executed
within a WebView, and React Native apps
are executed within JavaScriptCore, from a
technology perspective, these runtimes are
unique in their ability to leverage dynamic
code downloads according to the
aforementioned Apple developer
agreement."
CODE PUSH BEST PRACTICES
Check for updates on app start, but
don't apply until the next launch
Test thoroughly and monitor releases
closely
Don't surprise the user
React Native Consideration #4
Dynamic code updates are a
game changer, but should be
used responsibly.
React Native + LiveData
1. class BeerLiveDataModule :
ReactContextBaseJavaModule {
2. @Inject internal lateinit var repository:
BeerRepository
3. @Inject internal lateinit var gson: Gson
4.
5. private lateinit var liveData:
LiveData<List<Beer>>
Subscribe
3. componentDidMount() {
4. this.changeListener =
5. DeviceEventEmitter.addListener(
6. 'beersChanged',
7. this.onBeersChanged);
8. NativeModules.BeerLiveData.subscribe();
9. }
1. class BeerList extends React.Component {
2.
10.
11. componentWillUnmount() {
12. this.changeListener.remove();
13. NativeModules.BeerLiveData.unsubscribe();
Listen to change events
IS IT WORTH IT?
1. It’s a big dependency and may limit your
ability to upgrade other libraries.
2. It’s way different than normal Android
development.
3. Clean and maintainable cross-platform
code requires the commitment of
everyone on the team.
4. Dynamic code updates are a game
changer, but should be used responsibly.
LINKS
Blog: andydyer.org
Jobs @ Zalando: jobs.zalando.com
ProAndroidDev: proandroiddev.com
Twitter: @dammitandy

More Related Content

PPTX
Automated Testing and Continuous Deployment for Mobile Apps with Jenkins
PDF
Tomáš Kohout: Jak zrychlit iOS vývoj pomocí Swift playgoundů
PPT
Monkey Talk
PPT
Automated Testing and Continuous Integration for Mobile Apps: Jenkins & Cloud...
PDF
Evernote release process
PPTX
How to configure monkey talk android agent
PDF
Automated UI Testing Frameworks
PDF
My history with Jenkins
Automated Testing and Continuous Deployment for Mobile Apps with Jenkins
Tomáš Kohout: Jak zrychlit iOS vývoj pomocí Swift playgoundů
Monkey Talk
Automated Testing and Continuous Integration for Mobile Apps: Jenkins & Cloud...
Evernote release process
How to configure monkey talk android agent
Automated UI Testing Frameworks
My history with Jenkins

What's hot (20)

PPTX
How To Use Jenkins for Continuous Load and Mobile Testing with SOASTA & Cloud...
PDF
10 Best Mobile Test Automation Tools Used by Experts | What Automation Tools ...
PDF
Android Studio vs. ADT
PPTX
Ciao: Continuous Integration for Apps on OpenStack
PDF
Lessons Learned: Continuous Deployment For Docker (presented at Cloud Expo We...
PPTX
Vsts ci cd-java
PPTX
ATAGTR2017 Upgrading a mobile tester's weapons with advanced debugging
PPTX
Monkey talk
PDF
Ci/CD Android
PPTX
Automation Testing With Appium
PPTX
Rendra Toro - Model View Presenter
PPT
MonkeyTalk Automation Testing For Android Application
PPTX
Mobile Automation Using Appium - vodQA Bangalore 2015
PDF
Trust Your Pipeline - Automatically Testing and End-to-End Java Application
PDF
[Srijan Wednesday Webinars] Building a High Performance QA Team
PPTX
How Azure DevOps can boost your organization's productivity
PDF
mohansundarcv_2016
PDF
[Srijan Wednesday Webinar] Mastering Mobile Test Automation with Appium
PDF
Professional iOS development
PDF
MonkeyTalk Documentation
How To Use Jenkins for Continuous Load and Mobile Testing with SOASTA & Cloud...
10 Best Mobile Test Automation Tools Used by Experts | What Automation Tools ...
Android Studio vs. ADT
Ciao: Continuous Integration for Apps on OpenStack
Lessons Learned: Continuous Deployment For Docker (presented at Cloud Expo We...
Vsts ci cd-java
ATAGTR2017 Upgrading a mobile tester's weapons with advanced debugging
Monkey talk
Ci/CD Android
Automation Testing With Appium
Rendra Toro - Model View Presenter
MonkeyTalk Automation Testing For Android Application
Mobile Automation Using Appium - vodQA Bangalore 2015
Trust Your Pipeline - Automatically Testing and End-to-End Java Application
[Srijan Wednesday Webinars] Building a High Performance QA Team
How Azure DevOps can boost your organization's productivity
mohansundarcv_2016
[Srijan Wednesday Webinar] Mastering Mobile Test Automation with Appium
Professional iOS development
MonkeyTalk Documentation
Ad

Similar to React Native: Is It Worth It? UA Mobile 2017. (20)

PDF
Final NEWS.pdf
PDF
Final NewsApp.pdf
PDF
Hacking the Codename One Source Code - Part IV - Transcript.pdf
PPTX
Getting Started With React Native Presntation
PDF
PDF
Bird.pdf
PDF
How To Integrate Native Android App With React Native.
PPTX
GDG Devfest 2016 session on Android N
PPTX
How create react app help in creating a new react applications
PPTX
Appium solution artizone
PDF
React Native App Development in 2023-Tips to Practice.pdf
PPTX
PDF
Future Scope of React Native for Mobile App Development.pdf
PDF
React Native- The Future of Mobile App Development.
PDF
Why big organizations like tesla, facebook, walmart, skype are using react na...
PPTX
Lecture 1 Introduction to React Native.pptx
PPTX
Nativescript with angular 2
PDF
What is React Native and Why Should You Choose It For Mobile App
PDF
Compose Camp - Session2.pdf
PDF
React Native
Final NEWS.pdf
Final NewsApp.pdf
Hacking the Codename One Source Code - Part IV - Transcript.pdf
Getting Started With React Native Presntation
Bird.pdf
How To Integrate Native Android App With React Native.
GDG Devfest 2016 session on Android N
How create react app help in creating a new react applications
Appium solution artizone
React Native App Development in 2023-Tips to Practice.pdf
Future Scope of React Native for Mobile App Development.pdf
React Native- The Future of Mobile App Development.
Why big organizations like tesla, facebook, walmart, skype are using react na...
Lecture 1 Introduction to React Native.pptx
Nativescript with angular 2
What is React Native and Why Should You Choose It For Mobile App
Compose Camp - Session2.pdf
React Native
Ad

More from UA Mobile (20)

PDF
Designing iOS+Android project without using multiplatform frameworks - UA Mob...
PDF
Декларативное программирование клиент-серверных приложений на андроид - UA Mo...
PDF
Leave your Room behind - UA Mobile 2019
PDF
OpenId and OAuth2: Rear, Medium, Well Done - UA Mobile 2019
PDF
Google Wear OS watch faces and applications development - UA Mobile 2019
PDF
Історія декількох проектів та що в них пішло не так - UA Mobile 2019
PDF
Working effectively with ViewModels and TDD - UA Mobile 2019
PDF
Managing State in Reactive applications - UA Mobile 2019
PDF
Ідіоматична ін'єкція залежностей на Kotlin без фреймворків - UA Mobile2019
PDF
Актуальні практики дизайну мобільних додатків - UA Mobile 2019
PDF
До чого прикладати Docker в Android? - UA Mobile 2019
PDF
Building your Flutter apps using Redux - UA Mobile 2019
PDF
Optional. Tips and Tricks - UA Mobile 2019
PDF
Designing iOS+Android project without using multiplatform frameworks - UA Mob...
PDF
Бібліотеки та Інструменти на сторожі коду - UA Mobile 2019
PDF
Flutter: No more boring apps! - UA Mobile 2019
PDF
Долаючи прірву між дизайнерами та розробниками - UA Mobile 2019
PDF
Multiplatform shared codebase with Kotlin/Native - UA Mobile 2019
PDF
Sceneform SDK на практиці - UA Mobile 2019
PDF
Coroutines in Kotlin. UA Mobile 2017.
Designing iOS+Android project without using multiplatform frameworks - UA Mob...
Декларативное программирование клиент-серверных приложений на андроид - UA Mo...
Leave your Room behind - UA Mobile 2019
OpenId and OAuth2: Rear, Medium, Well Done - UA Mobile 2019
Google Wear OS watch faces and applications development - UA Mobile 2019
Історія декількох проектів та що в них пішло не так - UA Mobile 2019
Working effectively with ViewModels and TDD - UA Mobile 2019
Managing State in Reactive applications - UA Mobile 2019
Ідіоматична ін'єкція залежностей на Kotlin без фреймворків - UA Mobile2019
Актуальні практики дизайну мобільних додатків - UA Mobile 2019
До чого прикладати Docker в Android? - UA Mobile 2019
Building your Flutter apps using Redux - UA Mobile 2019
Optional. Tips and Tricks - UA Mobile 2019
Designing iOS+Android project without using multiplatform frameworks - UA Mob...
Бібліотеки та Інструменти на сторожі коду - UA Mobile 2019
Flutter: No more boring apps! - UA Mobile 2019
Долаючи прірву між дизайнерами та розробниками - UA Mobile 2019
Multiplatform shared codebase with Kotlin/Native - UA Mobile 2019
Sceneform SDK на практиці - UA Mobile 2019
Coroutines in Kotlin. UA Mobile 2017.

Recently uploaded (9)

PPTX
ASMS Telecommunication company Profile
DOC
Camb毕业证学历认证,格罗斯泰斯特主教大学毕业证仿冒文凭毕业证
PDF
6-UseCfgfhgfhgfhgfhgfhfhhaseActivity.pdf
PDF
Lesson 13- HEREDITY _ pedSAWEREGFVCXZDSASEWFigree.pdf
DOC
SIUE毕业证学历认证,阿祖萨太平洋大学毕业证学位证书复制
DOC
NIU毕业证学历认证,阿比林基督大学毕业证留学生学历
PPTX
Introduction to Packet Tracer Course Overview - Aug 21 (1).pptx
PDF
Best 4 Sites for Buy Verified Cash App Accounts – BTC Only.pdf
PDF
2025 Guide to Buy Verified Cash App Accounts You Can Trust.pdf
ASMS Telecommunication company Profile
Camb毕业证学历认证,格罗斯泰斯特主教大学毕业证仿冒文凭毕业证
6-UseCfgfhgfhgfhgfhgfhfhhaseActivity.pdf
Lesson 13- HEREDITY _ pedSAWEREGFVCXZDSASEWFigree.pdf
SIUE毕业证学历认证,阿祖萨太平洋大学毕业证学位证书复制
NIU毕业证学历认证,阿比林基督大学毕业证留学生学历
Introduction to Packet Tracer Course Overview - Aug 21 (1).pptx
Best 4 Sites for Buy Verified Cash App Accounts – BTC Only.pdf
2025 Guide to Buy Verified Cash App Accounts You Can Trust.pdf

React Native: Is It Worth It? UA Mobile 2017.

  • 4. WHY REACT NATIVE? Fast iteration Cross-platform Learning something new
  • 6. Sample App 1. import React, { Component } from 'react'; 2. import { 3. AppRegistry, 4. StyleSheet, 5. Text, 6. TextInput, 7. View Run it: https://goo.gl/h5g2eg
  • 7. INTEGRATION WITH EXISTING APPS 1. Create package.json and run yarn to fetch dependencies 2. Add project from node_modules/ to settings.gradle 3. Add dependency to build.gradle 4. Add Activity to load JS component 5. Run yarn start to bundle JS and launch Activity
  • 10. What was the problem?
  • 11. DIFFERENT OKHTTP VERSIONS React Native 0.45 was using OkHttp 3.4 Our app was using a newer version Breaking changes between versions
  • 12. "Upgrade to OkHttp 3.8.0" PR Discussion
  • 13. "Upgrade to OkHttp 3.8.0" PR Discussion
  • 15. We're Not Done Yet...
  • 17. ...you lose the patent license...if you sue us for patent infringement. - Explaining React's License https://code.facebook.com/posts/112130496157735/explainin react-s-license/
  • 19. ...the Gutenberg team is going to...rewrite Gutenberg using a different library. - On React and WordPress https://ma.tt/2017/09/on-react-and-wordpress/
  • 20. React Native Consideration #1 It’s a big dependency and may limit your ability to upgrade other libraries.
  • 21. DEVELOPING WITH REACT NATIVE Your favorite text editor Chrome Developer Tools More typing...but much less checking Twitter while waiting for builds
  • 22. Java is to JavaScript as Car is to Carpet Use TypeScript or Flow Con gure a linter Con gure Prettier to auto format on save
  • 24. NOT-SO-GREAT THINGS Handling orientation changes android:configChanges="keyboard |keyboardHidden|orientation|screenSiz or lock to portrait Third party libraries required for standard things like Material Design and i8ln Interop with native code requires extra classes
  • 25. React Native Consideration #2 It’s way different than normal Android development.
  • 27. TESTING REACT NATIVE APPS Jest - Snapshot testing Detox - Espresso like UI testing Enzyme - Robolectric like UI testing
  • 28. CROSS-PLATFORM THAT DOESN'T SUCK Best practices are still evolving. How much to share? What is okay to duplicate? Stick to native code where you need it.
  • 29. Android code 1. if (Platform.OS === 'android') { 2. alert('Android'); 3. } else { 4. alert('iOS'); 5. }
  • 30. FILE NAME CONVENTION Android iOS index.android.js index.ios.js
  • 31. React Native Consideration #3 Clean and maintainable cross- platform code requires the commitment of everyone on the team.
  • 32. APP UPDATES WITH CODEPUSH "According to section 3.3.2 of Apple’s developer agreement, as long as you are using the CodePush service to release bug xes and improvements/features that maintain the app’s original/presented purpose (i.e. don’t CodePush a calculator into a rst-person shooter), then you will be ne, and your users will be happy."
  • 33. APP UPDATES WITH CODEPUSH "Because Cordova apps are executed within a WebView, and React Native apps are executed within JavaScriptCore, from a technology perspective, these runtimes are unique in their ability to leverage dynamic code downloads according to the aforementioned Apple developer agreement."
  • 34. CODE PUSH BEST PRACTICES Check for updates on app start, but don't apply until the next launch Test thoroughly and monitor releases closely Don't surprise the user
  • 35. React Native Consideration #4 Dynamic code updates are a game changer, but should be used responsibly.
  • 36. React Native + LiveData 1. class BeerLiveDataModule : ReactContextBaseJavaModule { 2. @Inject internal lateinit var repository: BeerRepository 3. @Inject internal lateinit var gson: Gson 4. 5. private lateinit var liveData: LiveData<List<Beer>>
  • 37. Subscribe 3. componentDidMount() { 4. this.changeListener = 5. DeviceEventEmitter.addListener( 6. 'beersChanged', 7. this.onBeersChanged); 8. NativeModules.BeerLiveData.subscribe(); 9. } 1. class BeerList extends React.Component { 2. 10. 11. componentWillUnmount() { 12. this.changeListener.remove(); 13. NativeModules.BeerLiveData.unsubscribe(); Listen to change events
  • 38. IS IT WORTH IT? 1. It’s a big dependency and may limit your ability to upgrade other libraries. 2. It’s way different than normal Android development. 3. Clean and maintainable cross-platform code requires the commitment of everyone on the team. 4. Dynamic code updates are a game changer, but should be used responsibly.
  • 39. LINKS Blog: andydyer.org Jobs @ Zalando: jobs.zalando.com ProAndroidDev: proandroiddev.com Twitter: @dammitandy