SlideShare a Scribd company logo
React Native
Lessons from a year of building apps with
Ryan Boland
ryanboland.com // tanookilabs.com

ryan@tanookilabs.com

@bolandrm (github, twitter)
I’m Ryan Boland
Web Developer

@ Tanooki Labs
Slides
• ??
Goals
• Brief introduction to React Native itself

• Short demo on running a React Native app and
the development loop

• Decide whether React Native would be a good
fit for your project

• Sensible blueprint for starting your own React
Native app
My experience thus far
• Viewer + organizer for
financial research articles

• Ca-Ching! iOS + Android
Getting up to speed
on React Native
No real prerequisites for getting started, but having
someone on the team who is familiar with Xcode
and/or android studio is a huge help
React Native is a framework that allows you to
build native applications with JavaScript and React
import React, { Component } from 'react';
import { Image, ScrollView, Text } from 'react-native';
class ScrollingImageWithText extends Component {
render() {
return (
<ScrollView>
<Image
source={{uri: 'https://i.chzbgr.com/full/7345954048/h7E2C65F9/'}}
style={{width: 320, height:180}}
/>
<Text>
On iOS, a React Native ScrollView uses a native UIScrollView.
On Android, it uses a native ScrollView.
</Text>
</ScrollView>
);
}
}
https://facebook.github.io/react-native/
React Native is
real native
Lessons from a year of building apps with React Native
Directory structure
Directory structure
Directory structure
Directory structure
Directory structure
Layout + Styling
import React, { Component } from 'react';
import { AppRegistry, View } from 'react-native';
export default class FlexDirectionBasics extends Component {
render() {
return (
<View style={{flex: 1, flexDirection: 'row'}}>
<View style={{width: 50, height: 50, backgroundColor: 'powderblue'}} />
<View style={{width: 50, height: 50, backgroundColor: 'skyblue'}} />
<View style={{width: 50, height: 50, backgroundColor: 'steelblue'}} />
</View>
);
}
};
Layout + Styling
import React, { Component } from 'react';
import { AppRegistry, View } from 'react-native';
export default class FlexDirectionBasics extends Component {
render() {
return (
<View style={{flex: 1, flexDirection: 'row'}}>
<View style={{width: 50, height: 50, backgroundColor: 'powderblue'}} />
<View style={{width: 50, height: 50, backgroundColor: 'skyblue'}} />
<View style={{width: 50, height: 50, backgroundColor: 'steelblue'}} />
</View>
);
}
};
Layout + Styling
import React, { Component } from 'react';
import { AppRegistry, View } from 'react-native';
export default class FlexDirectionBasics extends Component {
render() {
return (
<View style={{flex: 1, flexDirection: 'row'}}>
<View style={{width: 50, height: 50, backgroundColor: 'powderblue'}} />
<View style={{width: 50, height: 50, backgroundColor: 'skyblue'}} />
<View style={{width: 50, height: 50, backgroundColor: 'steelblue'}} />
</View>
);
}
};
Built-in components
• View, Text, Image, TextInput, ScrollView, StyleSheet

• Button, Picker, Slider, Switch

• FlatList, SectionList

• ActivityIndicator, Alert, CameraRoll, Modal, etc…
Android / iOS specific code
Example: platform specific button.

• Write Android implementation in Button.android.js

• Write iOS implementation in Button.ios.js
import Button from 'Button';
...
Demo!
Why choose
React Native?
Fast Development
• Quick development loop - refresh the app
immediately in most cases (no waiting for
compile)

• The majority of your app’s code will be reused
between Android and iOS

• Take advantage of large JavaScript package
ecosystem
Your team can get
up to speed quickly
• Much of the work can be done by folks with
little native development experience

• Framework is made of simple, easy to use
components
No lock-in
• You can use React Native as much or as little
as you’d like (maybe you just want to use it for
settings or form pages)

• If you have a major component in your app,
you can write it in native code

• If the team outgrows react native, it can be
phased out over time
Discord article -> https://blog.discordapp.com/why-discord-is-sticking-with-react-native-ccc34be0d427
Downsides
• Many different technologies being used
simultaneously

• The build process is more complicated

• Updates can be painful (both React Native and
ios/android updates)

• Android support is lagging a bit
Spinning up your
first React Native
app
There are a lot of
decisions!
Frameworks /
boilerplates
Navigation
Lessons from a year of building apps with React Native
Lessons from a year of building apps with React Native
Lessons from a year of building apps with React Native
Lessons from a year of building apps with React Native
Organizing JS
MobX for state!
Airbnb on Redux
“…Redux is notorious for its boilerplate and
has a relatively difficult learning curve. We
provided generators for some common
templates but it was still one of the most
challenging pieces and source of confusion
while working with React Native.”
https://medium.com/airbnb-engineering/react-native-at-airbnb-the-technology-
dafd0b43838
Organizing JS
Component “pods”
// components/index.js and components/Button/index.js
// allow for the following:
import Button from ‘components’
Testing
import React from 'react'
import Button from 'app/components/Button'
import {shallow} from 'enzyme'
describe('Button component', () => {
it('is unclickable, renders with lower opacity with disabled prop', () => {
const wrapper = shallow(
<Button
disabled
text="Disabled"
/>
)
expect(wrapper).toMatchSnapshot()
})
})
Component Snapshot testing
Button.test.js
import React from 'react'
import Button from 'app/components/Button'
import {shallow} from 'enzyme'
describe('Button component', () => {
it('is unclickable, renders with lower opacity with disabled prop', () => {
const wrapper = shallow(
<Button
disabled
text="Disabled"
/>
)
expect(wrapper).toMatchSnapshot()
})
})
Component Snapshot testing
Button.test.js
import React from 'react'
import Button from 'app/components/Button'
import {shallow} from 'enzyme'
describe('Button component', () => {
it('is unclickable, renders with lower opacity with disabled prop', () => {
const wrapper = shallow(
<Button
disabled
text="Disabled"
/>
)
expect(wrapper).toMatchSnapshot()
})
})
Component Snapshot testing
Button.test.js
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Button component is unclickable, renders with lower opacity with disabled prop 1`] = `
<TouchableOpacity
activeOpacity={0.5}
disabled={true}
style={
Array [
Object {
"width": "100%",
},
undefined,
]
}
>
<Component
style={
Array [
Object {
"backgroundColor": "#49718C",
"borderRadius": 2,
"padding": 12,
},
Object {
"opacity": 0.6,
},
Object {},
]
}
>
<inject-Text-with-settings
style={
Array [
Object {
"color": "#FFFFFF",
"fontFamily": "SourceSansPro-SemiBold",
"textAlign": "center",
},
undefined,
]
}
>
Disabled
</inject-Text-with-settings>
</Component>
</TouchableOpacity>
`; Button.test.js.snap
“Golden master testing”
Sharing your App
Purpose Server Distributed via
Debug Local development Staging n/a
Internal
Internal / stakeholder

testing
Staging
Fabric Beta, hockey
app, etc
Beta/QA
Final approval / early
adopter testing
Production
Fabric Beta, hockey
app, etc
Release Release to public Production App Store
App Versions
App identifier -> com.tanookilabs.street-cuts.internal
react-native-device-info allows us to pull out the app
version from the app identifier:
import DeviceInfo from 'react-native-device-info'
export const isRelease = DeviceInfo.getBundleId().split('.').includes('release')
export const isBeta = DeviceInfo.getBundleId().split('.').includes('beta')
export const isInternal = DeviceInfo.getBundleId().split('.').includes('internal')
export const isDebug = DeviceInfo.getBundleId().split('.').includes('debug')
Use react-native-schemes-manager when creating non-
standard versions (e.g. internal/beta)
Continuous Integration
• Tests and linting are run for all pull requests

• Each push to master runs tests, linting, and builds iOS
and android internal version of the app

• Beta and release versions of the apps can be built on
demand
Shipping to the
app stores
Long Term
Maintenance
Update regularly!
https://github.com/ncuillery/rn-diff/
React Native is a game changer
for both developers and their
clients!
Further exploration
• Using CodePush to update production applications
without submitting through the app store processes

• Using TypeScript or Flow to avoid runtime errors
Thanks! Questions?
ryanboland.com // tanookilabs.com

ryan@tanookilabs.com

@bolandrm (github, twitter)
Tanooki Labs
Slides ->

More Related Content

PDF
React Native Workshop - React Alicante
PDF
Node.js and Selenium Webdriver, a journey from the Java side
PDF
ForwardJS 2017 - Fullstack end-to-end Test Automation with node.js
PDF
React Native - Workshop
PDF
Fullstack End-to-end test automation with Node.js, one year later
PDF
Test Driven Development with JavaFX
PDF
How to Implement Basic Angular Routing and Nested Routing With Params in Angu...
PDF
Kiss PageObjects [01-2017]
React Native Workshop - React Alicante
Node.js and Selenium Webdriver, a journey from the Java side
ForwardJS 2017 - Fullstack end-to-end Test Automation with node.js
React Native - Workshop
Fullstack End-to-end test automation with Node.js, one year later
Test Driven Development with JavaFX
How to Implement Basic Angular Routing and Nested Routing With Params in Angu...
Kiss PageObjects [01-2017]

What's hot (20)

PDF
Nightwatch at Tilt
PDF
Easy tests with Selenide and Easyb
PDF
Testing Web Applications
PDF
How to Build ToDo App with Vue 3 + TypeScript
PDF
Dependency Injection
PDF
Easy automation.py
PPTX
Behavior Driven Development Testing (BDD)
PDF
20160905 - BrisJS - nightwatch testing
PDF
Three Simple Chords of Alternative PageObjects and Hardcore of LoadableCompon...
PPT
A journey beyond the page object pattern
PDF
GlobalLogic Test Automation Online TechTalk “Playwright — A New Hope”
PDF
Front-End Testing: Demystified
PDF
Behavior Driven Development with Cucumber
ZIP
Automated Frontend Testing
PDF
Automated Testing in Angular Slides
PDF
Vuejs testing
PDF
Angular Application Testing
PDF
Testing nightwatch, by David Torroija
PPT
Testing in AngularJS
PDF
JavaFX JumpStart @JavaOne 2016
Nightwatch at Tilt
Easy tests with Selenide and Easyb
Testing Web Applications
How to Build ToDo App with Vue 3 + TypeScript
Dependency Injection
Easy automation.py
Behavior Driven Development Testing (BDD)
20160905 - BrisJS - nightwatch testing
Three Simple Chords of Alternative PageObjects and Hardcore of LoadableCompon...
A journey beyond the page object pattern
GlobalLogic Test Automation Online TechTalk “Playwright — A New Hope”
Front-End Testing: Demystified
Behavior Driven Development with Cucumber
Automated Frontend Testing
Automated Testing in Angular Slides
Vuejs testing
Angular Application Testing
Testing nightwatch, by David Torroija
Testing in AngularJS
JavaFX JumpStart @JavaOne 2016
Ad

Similar to Lessons from a year of building apps with React Native (20)

PPTX
React Native: Introduction
PPTX
JS Fest 2018. Илья Иванов. Введение в React-Native
PDF
Connect.js - Exploring React.Native
PPTX
React Native & NativeScript
PDF
Introduction to React for Frontend Developers
PPTX
How to create components in react js
PDF
Паразитируем на React-экосистеме (Angular 4+) / Алексей Охрименко (IPONWEB)
PDF
Mastering JavaScript and DOM: A Gateway to Web Development
PPTX
React native by example by Vadim Ruban
PPTX
Build Mobile Application with React-Native
PDF
From Backbone to Ember and Back(bone) Again
PDF
An iOS Developer's Perspective on React Native
PDF
React && React Native workshop
PDF
Building Universal Web Apps with React ForwardJS 2017
PPTX
Getting Started with React v16
PDF
React Native in Production
PDF
React Native
PPTX
React 101 by Anatoliy Sieryi
PDF
Universal JavaScript Web Applications with React - Luciano Mammino - Codemoti...
PDF
Universal JS Web Applications with React - Luciano Mammino - Codemotion Rome ...
React Native: Introduction
JS Fest 2018. Илья Иванов. Введение в React-Native
Connect.js - Exploring React.Native
React Native & NativeScript
Introduction to React for Frontend Developers
How to create components in react js
Паразитируем на React-экосистеме (Angular 4+) / Алексей Охрименко (IPONWEB)
Mastering JavaScript and DOM: A Gateway to Web Development
React native by example by Vadim Ruban
Build Mobile Application with React-Native
From Backbone to Ember and Back(bone) Again
An iOS Developer's Perspective on React Native
React && React Native workshop
Building Universal Web Apps with React ForwardJS 2017
Getting Started with React v16
React Native in Production
React Native
React 101 by Anatoliy Sieryi
Universal JavaScript Web Applications with React - Luciano Mammino - Codemoti...
Universal JS Web Applications with React - Luciano Mammino - Codemotion Rome ...
Ad

Recently uploaded (20)

PDF
GamePlan Trading System Review: Professional Trader's Honest Take
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Machine learning based COVID-19 study performance prediction
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
cuic standard and advanced reporting.pdf
PDF
Empathic Computing: Creating Shared Understanding
PDF
solutions_manual_-_materials___processing_in_manufacturing__demargo_.pdf
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
Cloud computing and distributed systems.
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
GDG Cloud Iasi [PUBLIC] Florian Blaga - Unveiling the Evolution of Cybersecur...
PPTX
breach-and-attack-simulation-cybersecurity-india-chennai-defenderrabbit-2025....
GamePlan Trading System Review: Professional Trader's Honest Take
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Reach Out and Touch Someone: Haptics and Empathic Computing
Machine learning based COVID-19 study performance prediction
NewMind AI Monthly Chronicles - July 2025
The Rise and Fall of 3GPP – Time for a Sabbatical?
Review of recent advances in non-invasive hemoglobin estimation
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
“AI and Expert System Decision Support & Business Intelligence Systems”
cuic standard and advanced reporting.pdf
Empathic Computing: Creating Shared Understanding
solutions_manual_-_materials___processing_in_manufacturing__demargo_.pdf
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Cloud computing and distributed systems.
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Chapter 3 Spatial Domain Image Processing.pdf
Spectral efficient network and resource selection model in 5G networks
GDG Cloud Iasi [PUBLIC] Florian Blaga - Unveiling the Evolution of Cybersecur...
breach-and-attack-simulation-cybersecurity-india-chennai-defenderrabbit-2025....

Lessons from a year of building apps with React Native

  • 1. React Native Lessons from a year of building apps with Ryan Boland
  • 2. ryanboland.com // tanookilabs.com ryan@tanookilabs.com @bolandrm (github, twitter) I’m Ryan Boland Web Developer @ Tanooki Labs
  • 4. Goals • Brief introduction to React Native itself • Short demo on running a React Native app and the development loop • Decide whether React Native would be a good fit for your project • Sensible blueprint for starting your own React Native app
  • 5. My experience thus far • Viewer + organizer for financial research articles • Ca-Ching! iOS + Android
  • 6. Getting up to speed on React Native No real prerequisites for getting started, but having someone on the team who is familiar with Xcode and/or android studio is a huge help
  • 7. React Native is a framework that allows you to build native applications with JavaScript and React import React, { Component } from 'react'; import { Image, ScrollView, Text } from 'react-native'; class ScrollingImageWithText extends Component { render() { return ( <ScrollView> <Image source={{uri: 'https://i.chzbgr.com/full/7345954048/h7E2C65F9/'}} style={{width: 320, height:180}} /> <Text> On iOS, a React Native ScrollView uses a native UIScrollView. On Android, it uses a native ScrollView. </Text> </ScrollView> ); } } https://facebook.github.io/react-native/
  • 15. Layout + Styling import React, { Component } from 'react'; import { AppRegistry, View } from 'react-native'; export default class FlexDirectionBasics extends Component { render() { return ( <View style={{flex: 1, flexDirection: 'row'}}> <View style={{width: 50, height: 50, backgroundColor: 'powderblue'}} /> <View style={{width: 50, height: 50, backgroundColor: 'skyblue'}} /> <View style={{width: 50, height: 50, backgroundColor: 'steelblue'}} /> </View> ); } };
  • 16. Layout + Styling import React, { Component } from 'react'; import { AppRegistry, View } from 'react-native'; export default class FlexDirectionBasics extends Component { render() { return ( <View style={{flex: 1, flexDirection: 'row'}}> <View style={{width: 50, height: 50, backgroundColor: 'powderblue'}} /> <View style={{width: 50, height: 50, backgroundColor: 'skyblue'}} /> <View style={{width: 50, height: 50, backgroundColor: 'steelblue'}} /> </View> ); } };
  • 17. Layout + Styling import React, { Component } from 'react'; import { AppRegistry, View } from 'react-native'; export default class FlexDirectionBasics extends Component { render() { return ( <View style={{flex: 1, flexDirection: 'row'}}> <View style={{width: 50, height: 50, backgroundColor: 'powderblue'}} /> <View style={{width: 50, height: 50, backgroundColor: 'skyblue'}} /> <View style={{width: 50, height: 50, backgroundColor: 'steelblue'}} /> </View> ); } };
  • 18. Built-in components • View, Text, Image, TextInput, ScrollView, StyleSheet • Button, Picker, Slider, Switch • FlatList, SectionList • ActivityIndicator, Alert, CameraRoll, Modal, etc…
  • 19. Android / iOS specific code Example: platform specific button. • Write Android implementation in Button.android.js • Write iOS implementation in Button.ios.js import Button from 'Button'; ...
  • 20. Demo!
  • 22. Fast Development • Quick development loop - refresh the app immediately in most cases (no waiting for compile) • The majority of your app’s code will be reused between Android and iOS • Take advantage of large JavaScript package ecosystem
  • 23. Your team can get up to speed quickly • Much of the work can be done by folks with little native development experience • Framework is made of simple, easy to use components
  • 24. No lock-in • You can use React Native as much or as little as you’d like (maybe you just want to use it for settings or form pages) • If you have a major component in your app, you can write it in native code • If the team outgrows react native, it can be phased out over time Discord article -> https://blog.discordapp.com/why-discord-is-sticking-with-react-native-ccc34be0d427
  • 25. Downsides • Many different technologies being used simultaneously • The build process is more complicated • Updates can be painful (both React Native and ios/android updates) • Android support is lagging a bit
  • 26. Spinning up your first React Native app
  • 27. There are a lot of decisions!
  • 36. Airbnb on Redux “…Redux is notorious for its boilerplate and has a relatively difficult learning curve. We provided generators for some common templates but it was still one of the most challenging pieces and source of confusion while working with React Native.” https://medium.com/airbnb-engineering/react-native-at-airbnb-the-technology- dafd0b43838
  • 38. Component “pods” // components/index.js and components/Button/index.js // allow for the following: import Button from ‘components’
  • 40. import React from 'react' import Button from 'app/components/Button' import {shallow} from 'enzyme' describe('Button component', () => { it('is unclickable, renders with lower opacity with disabled prop', () => { const wrapper = shallow( <Button disabled text="Disabled" /> ) expect(wrapper).toMatchSnapshot() }) }) Component Snapshot testing Button.test.js
  • 41. import React from 'react' import Button from 'app/components/Button' import {shallow} from 'enzyme' describe('Button component', () => { it('is unclickable, renders with lower opacity with disabled prop', () => { const wrapper = shallow( <Button disabled text="Disabled" /> ) expect(wrapper).toMatchSnapshot() }) }) Component Snapshot testing Button.test.js
  • 42. import React from 'react' import Button from 'app/components/Button' import {shallow} from 'enzyme' describe('Button component', () => { it('is unclickable, renders with lower opacity with disabled prop', () => { const wrapper = shallow( <Button disabled text="Disabled" /> ) expect(wrapper).toMatchSnapshot() }) }) Component Snapshot testing Button.test.js
  • 43. // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Button component is unclickable, renders with lower opacity with disabled prop 1`] = ` <TouchableOpacity activeOpacity={0.5} disabled={true} style={ Array [ Object { "width": "100%", }, undefined, ] } > <Component style={ Array [ Object { "backgroundColor": "#49718C", "borderRadius": 2, "padding": 12, }, Object { "opacity": 0.6, }, Object {}, ] } > <inject-Text-with-settings style={ Array [ Object { "color": "#FFFFFF", "fontFamily": "SourceSansPro-SemiBold", "textAlign": "center", }, undefined, ] } > Disabled </inject-Text-with-settings> </Component> </TouchableOpacity> `; Button.test.js.snap “Golden master testing”
  • 44. Sharing your App Purpose Server Distributed via Debug Local development Staging n/a Internal Internal / stakeholder testing Staging Fabric Beta, hockey app, etc Beta/QA Final approval / early adopter testing Production Fabric Beta, hockey app, etc Release Release to public Production App Store
  • 45. App Versions App identifier -> com.tanookilabs.street-cuts.internal react-native-device-info allows us to pull out the app version from the app identifier: import DeviceInfo from 'react-native-device-info' export const isRelease = DeviceInfo.getBundleId().split('.').includes('release') export const isBeta = DeviceInfo.getBundleId().split('.').includes('beta') export const isInternal = DeviceInfo.getBundleId().split('.').includes('internal') export const isDebug = DeviceInfo.getBundleId().split('.').includes('debug') Use react-native-schemes-manager when creating non- standard versions (e.g. internal/beta)
  • 46. Continuous Integration • Tests and linting are run for all pull requests • Each push to master runs tests, linting, and builds iOS and android internal version of the app • Beta and release versions of the apps can be built on demand
  • 50. React Native is a game changer for both developers and their clients!
  • 51. Further exploration • Using CodePush to update production applications without submitting through the app store processes • Using TypeScript or Flow to avoid runtime errors
  • 52. Thanks! Questions? ryanboland.com // tanookilabs.com ryan@tanookilabs.com @bolandrm (github, twitter) Tanooki Labs Slides ->