Crossing platforms with
JavaScript & React
@robdel12
JavaScript is
EVERYWHERE
Web
Server
iOS
Android
Desktop
Crossing platforms with JavaScript & React
What is cross platform
JS?
JS that can run on
more than one platform
Crossing platforms with JavaScript & React
“Why did the iOS team implement it
like this?”
“The Android app currently doesn’t
support that”
https://twitter.com/dan_abramov/status/812047645732651009
Easier to share code across many
teams
More team collaboration since there’s
more overlap
It allows teams to own products & not
be separated by technology
TL;DR your team now owns the iOS,
Android, and (maybe) web apps.
Consistency is 🔑
Cheaper
If you can build iOS & Android apps in the
same code base it should be cheaper
Why not bet on the web?
Native will be better than mobile web
for a while
Why not take the web tooling & get
native results?
You are betting on the web
Can’t beat them, join them
I decided to be ambitious
Build an Instagram clone for Web, iOS,
& Android
Why an Instagram clone?
Use Impagination.js to power an
Infinite scroll of images
Crossing platforms with JavaScript & React
Impagination will work on any JS
codebase
Building infinite scroll in React Native
with Impagination
http://bit.ly/reactnativeinfinitescroll
We’ve already used Impagination in
four different platforms
What else can be shared?
Experiment time
Crossing platforms with JavaScript & React
Three phases to the
experiment
• Planning
• Implementation
• Postmortem
Planning
Crossing platforms with JavaScript & React
🥞The stack🥞
• React Native
• React (DOM)
• Auth0 (authentication)
• Graph.cool (backend)
• Impagination (infinite datasets)
What should the app do?
• Login / Sign up
• See your profile & images you’ve posted
• Edit your profile
• Post a new photo
• Main list feed showing everyones posts
Web demo
Implementation
What’s the approach?
Build the web app
Start to build the native app
Realize I’ve already solved these
problems in the web app
Refactor
ListPage.js
ListPage.js handles both UI & data
right now
ListPage for native duplicates a lot
form web ListPage
class ListPage extends React.Component {
static propTypes = {
data: React.PropTypes.object,
}
state = {
dataset: null,
datasetState: null,
}
setupImpagination() {}
componentWillMount() {this.setupImpagination();}
setCurrentReadOffset = (event) => {}
render () {
return (
<div style={{maxWidth: "600px", margin: "0 auto", padding: "20px 0"}}>
<Infinite elementHeight={ITEM_HEIGHT} handleScroll={this.setCurrentReadOffset}
useWindowAsScrollContainer>
{this.state.datasetState.map(record => {
if (record.isPending && !record.isSettled) {
return <LoadingPost key={Math.random()} />;
}
return <Photo key={record.content.id} photo={record.content} user={record.content.user} />;
})}
</Infinite>
</div>
);
}
}
const FeedQuery = gql`query($skip: Int!, $first: Int!) {
allPhotos(orderBy: createdAt_DESC, first: $first, skip: $skip) {
}
}`;
export default graphql(FeedQuery, {options: {variables: { skip: 0, first: PAGE_SIZE }}})(ListPage);
Web ListPage.js
`
class ListPage extends React.Component {
static propTypes = {
data: React.PropTypes.object,
}
state = {
dataset: null,
datasetState: null,
}
setupImpagination() {}
componentWillMount() {this.setupImpagination();}
setCurrentReadOffset = (event) => {}
render () {
return (
<ScrollView style={{flex: 1}} scrollEventThrottle={300}
onScroll={this.setCurrentReadOffset} removeClippedSubviews={true}>
{this.state.datasetState.map(record => {
if(record.isPending && !record.isSettled) {
return <LoadingPost key={Math.random()}/>;
}
return <Photo key={record.content.id} photo={record.content} user={record.content.user} />;
})}
</ScrollView>
);
}
}
const FeedQuery = gql`query($skip: Int!, $first: Int!) {
allPhotos(orderBy: createdAt_DESC, first: $first, skip: $skip) {
}
}`;
export default graphql(FeedQuery, {options: {variables: { skip: 0, first: PAGE_SIZE }}})(ListPage);
Native ListPage.js
Everything but the UI is the same
New structure
Presentation & container components
<IndexRoute component={ListPageContainer} />
<Route path='feed' component={ListPageContainer} />
import ListPageView from ‘../components/presentational/ListPageView’;
class ListPageContainer extends React.Component {
state = {
dataset: null,
datasetState: null,
}
setupImpagination() {}
componentWillMount() {this.setupImpagination();}
setCurrentReadOffset = (event) => {}
render () {
return (
<ListPageView setCurrentReadOffset={this.setCurrentReadOffset}
datasetState={this.state.datasetState} />;
);
}
}
const FeedQuery = gql`query($skip: Int!, $first: Int!) {
allPhotos(orderBy: createdAt_DESC, first: $first, skip: $skip) {
}
}`;
export default graphql(FeedQuery, {options: {variables: { skip: 0, first: PAGE_SIZE }}})(ListPage);
Make the container component render
a separate presentation component
Leave setting the readOffset to the
presentation components
setCurrentReadOffset function is passed
as a prop from the container component
t
import React, { Component } from 'react';
import Infinite from 'react-infinite';
import Photo from '../presentational/Photo';
import LoadingPost from '../presentational/LoadingPost';
const ITEM_HEIGHT = 600;
const HEADER_HEIGHT = 80;
class ListPageView extends Component {
setCurrentReadOffset = (event) => {
let currentItemIndex = Math.ceil((window.scrollY - HEADER_HEIGHT) / ITEM_HEIGHT);
this.props.setCurrentReadOffset(currentItemIndex);
}
render() {
return (
<div style={{maxWidth: "600px", margin: "0 auto", padding: "20px 0"}}>
<Infinite elementHeight={ITEM_HEIGHT} handleScroll={this.setCurrentReadOffset}
useWindowAsScrollContainer>
{this.props.datasetState.map(record => {
if (record.isPending && !record.isSettled) {
return <LoadingPost key={Math.random()} />;
}
return <Photo key={record.content.id} photo={record.content}
user={record.content.user} />;
})}
</Infinite>
</div>
);
}
}
export default ListPageView;
Web presentation component
Native presentation component
import React, { Component } from 'react';
import Photo from '../presentational/Photo';
import LoadingPost from '../presentational/LoadingPost';
import {
ScrollView
} from 'react-native';
const ITEM_HEIGHT = 485;
class ListPageView extends Component {
setCurrentReadOffset = (event) => {
let currentOffset = Math.floor(event.nativeEvent.contentOffset.y);
let currentItemIndex = Math.ceil(currentOffset / ITEM_HEIGHT);
this.props.setCurrentReadOffset(currentItemIndex);
}
render() {
return (
<ScrollView style={{flex: 1}} scrollEventThrottle={300}
onScroll={this.setCurrentReadOffset} removeClippedSubviews={true}>
{this.props.datasetState.map(record => {
if(record.isPending && !record.isSettled) {
return <LoadingPost key={Math.random()}/>;
}
return <Photo key={record.content.id} photo={record.content}
user={record.content.user} />;
})}
</ScrollView>
);
}
}
export default ListPageView;
This theme continues throughout the
entire app
<IndexRoute component={ListPageContainer} />
<Route path='feed' component={ListPageContainer} />
<Route path='new' component={CreatePostContainer}
onEnter={this.requireAuth.bind(this)} />
<Route path='signup' component={CreateUserContainer} />
<Route path='profile' component={UserProfileContainer} >
<IndexRoute component={UserProfileContainer} />
<Route path='edit' component={EditProfileContainer} />
</Route>
<Route path='logout' component={() =>
<Logout logout={this.handleToken.bind(this)} />
} />
Native app demo
Postmortem
Building the apps in time was hard…
Crossing platforms with JavaScript & React
Crossing platforms with JavaScript & React
Figuring out what code is shareable
Figuring out how to make that code
shareable
React Router is neat & works cross
platform
There are different imports for React Native
& React
Crossing platforms with JavaScript & React
Auth0 was very easy to implement on
both platforms.
There are different APIs for React Native &
React
AsyncStorage vs localStorage
What all ended up being shared?
✅ List feed
✅ User profile
✅ Edit user profile
✅ Sign up
✅ New post
Beyond login mostly everything else is
the same
The UI changed but not the business
logic
Key takeaways
We’re in a post DOM world
Write JavaScript interaction models
The UI framework will change but the
underlying model driving it won’t
“It’s just JavaScript”
We get stronger libraries by increasing
the number of users & contributors.
React makes this very easy thanks to
React & React Native
I was able to share the same five container
components across three different platforms
Write one container component and
many UI components
The core of this app is shared
That’s a cost savings
I own this entire product & its 3
platforms
In 2 weeks I was able do all of this
Cross platform JS FTW
Instagram also agrees with me
https://engineering.instagram.com/react-native-at-instagram-
dd828a9a90c7#.i364vchox
Crossing platforms with JavaScript & React
If this kind of stuff interests you
We’re hiring!
Thanks!
@robdel12

More Related Content

PDF
Integrating React.js with PHP projects
PPTX
Client-side Rendering with AngularJS
PPTX
20141001 delapsley-oc-openstack-final
PPTX
React with Redux
PDF
Arquitetando seu aplicativo Android com Jetpack
PDF
Introduction to React & Redux
PDF
SwiftUI and Combine All the Things
PDF
My Top 5 APEX JavaScript API's
Integrating React.js with PHP projects
Client-side Rendering with AngularJS
20141001 delapsley-oc-openstack-final
React with Redux
Arquitetando seu aplicativo Android com Jetpack
Introduction to React & Redux
SwiftUI and Combine All the Things
My Top 5 APEX JavaScript API's

What's hot (20)

PPT
jQuery for beginners
PPTX
Angular Tutorial Freshers and Experienced
PDF
Introduction to Redux
PPT
Backbone.js
PPTX
AngularJs
PDF
Zepto.js, a jQuery-compatible mobile JavaScript framework in 2K
PDF
Unit Testing at Scale
PDF
Test-driven Development with AEM
PDF
Ultimate Introduction To AngularJS
PDF
Rails 3: Dashing to the Finish
PDF
Using Task Queues and D3.js to build an analytics product on App Engine
PPTX
Basics of AngularJS
PDF
jQuery & 10,000 Global Functions: Working with Legacy JavaScript
PDF
How to build an AngularJS backend-ready app WITHOUT BACKEND
PDF
Getting Started with Combine And SwiftUI
KEY
Design Patterns for Tablets and Smartphones
PPTX
Tips for Angular Applications
PDF
Solid angular
ODP
AngularJs Crash Course
PDF
AngularJS Basics with Example
jQuery for beginners
Angular Tutorial Freshers and Experienced
Introduction to Redux
Backbone.js
AngularJs
Zepto.js, a jQuery-compatible mobile JavaScript framework in 2K
Unit Testing at Scale
Test-driven Development with AEM
Ultimate Introduction To AngularJS
Rails 3: Dashing to the Finish
Using Task Queues and D3.js to build an analytics product on App Engine
Basics of AngularJS
jQuery & 10,000 Global Functions: Working with Legacy JavaScript
How to build an AngularJS backend-ready app WITHOUT BACKEND
Getting Started with Combine And SwiftUI
Design Patterns for Tablets and Smartphones
Tips for Angular Applications
Solid angular
AngularJs Crash Course
AngularJS Basics with Example
Ad

Viewers also liked (20)

PDF
React vs angular (mobile first battle)
PPTX
React + Redux Introduction
PDF
React vs-angular-mobile
PPTX
Introduction to Facebook React
PDF
Discover React
PPTX
Línea de Desarrollo Humano 2017
PDF
Southern Traditions Outdoors July - August 2016
ODT
Animales en la Grecia Antigua
PPTX
React vs Angular: ups & downs (speaker Oleksandr Kovalov, Binary Studio)
ODT
Obra de Teatro sobre los Dioses Griegos
PDF
Grupos Sociales en la Antigua Grecia
PDF
Mitología Griega
PDF
¿Dónde vivían los griegos?
PDF
Angular 2 vs React
PPTX
Introduction to react_js
PPTX
Angular vs Angular 2 vs React. Сергей Александров
PDF
Angular js vs. Facebook react
PDF
Introduction to ReactJS
PPTX
Formas poéticas
React vs angular (mobile first battle)
React + Redux Introduction
React vs-angular-mobile
Introduction to Facebook React
Discover React
Línea de Desarrollo Humano 2017
Southern Traditions Outdoors July - August 2016
Animales en la Grecia Antigua
React vs Angular: ups & downs (speaker Oleksandr Kovalov, Binary Studio)
Obra de Teatro sobre los Dioses Griegos
Grupos Sociales en la Antigua Grecia
Mitología Griega
¿Dónde vivían los griegos?
Angular 2 vs React
Introduction to react_js
Angular vs Angular 2 vs React. Сергей Александров
Angular js vs. Facebook react
Introduction to ReactJS
Formas poéticas
Ad

Similar to Crossing platforms with JavaScript & React (20)

PDF
Boosting Data Fetching in Turkish Apps with React Native and GraphQL
PDF
Getting Started with Relay Modern
PDF
UI 모듈화로 워라밸 지키기
PDF
React native meetup 2019
PDF
Connect.js - Exploring React.Native
PDF
An Emoji Introduction to React Native (Panagiotis Vourtsis, Senior Front End ...
PDF
Pieter De Baets - An introduction to React Native
PDF
Tokyo React.js #3: Missing Pages: ReactJS/Flux/GraphQL/RelayJS
PDF
React Native: JS MVC Meetup #15
PDF
How React Native has changed Web and Mobile Application Development, Engineer...
PPTX
JS Fest 2018. Илья Иванов. Введение в React-Native
PDF
Mobile Open Day: React Native: Crossplatform fast dive
PPTX
React 16: new features and beyond
PDF
React native: building native iOS apps with javascript
PDF
Implement react pagination with react hooks and react paginate
PPT
PPTX
Lecture 2 Styling and Layout in React Native.pptx
PPTX
React native introduction
PDF
N Things You Don't Want to Repeat in React Native
PDF
Learning React Native Building Native Mobile Apps with JavaScript 2nd Edition...
Boosting Data Fetching in Turkish Apps with React Native and GraphQL
Getting Started with Relay Modern
UI 모듈화로 워라밸 지키기
React native meetup 2019
Connect.js - Exploring React.Native
An Emoji Introduction to React Native (Panagiotis Vourtsis, Senior Front End ...
Pieter De Baets - An introduction to React Native
Tokyo React.js #3: Missing Pages: ReactJS/Flux/GraphQL/RelayJS
React Native: JS MVC Meetup #15
How React Native has changed Web and Mobile Application Development, Engineer...
JS Fest 2018. Илья Иванов. Введение в React-Native
Mobile Open Day: React Native: Crossplatform fast dive
React 16: new features and beyond
React native: building native iOS apps with javascript
Implement react pagination with react hooks and react paginate
Lecture 2 Styling and Layout in React Native.pptx
React native introduction
N Things You Don't Want to Repeat in React Native
Learning React Native Building Native Mobile Apps with JavaScript 2nd Edition...

Recently uploaded (20)

PPTX
Graph Data Structures with Types, Traversals, Connectivity, and Real-Life App...
PDF
20250617 - IR - Global Guide for HR - 51 pages.pdf
PPTX
MAD Unit - 3 User Interface and Data Management (Diploma IT)
PDF
LOW POWER CLASS AB SI POWER AMPLIFIER FOR WIRELESS MEDICAL SENSOR NETWORK
PDF
Unit1 - AIML Chapter 1 concept and ethics
PDF
MLpara ingenieira CIVIL, meca Y AMBIENTAL
PDF
distributed database system" (DDBS) is often used to refer to both the distri...
PDF
Applications of Equal_Area_Criterion.pdf
PPTX
ASME PCC-02 TRAINING -DESKTOP-NLE5HNP.pptx
PDF
August -2025_Top10 Read_Articles_ijait.pdf
PPTX
AUTOMOTIVE ENGINE MANAGEMENT (MECHATRONICS).pptx
PDF
Design of Material Handling Equipment Lecture Note
PDF
First part_B-Image Processing - 1 of 2).pdf
PPT
Chapter 1 - Introduction to Manufacturing Technology_2.ppt
PDF
Present and Future of Systems Engineering: Air Combat Systems
PPTX
wireless networks, mobile computing.pptx
PPTX
Module 8- Technological and Communication Skills.pptx
PDF
Computer organization and architecuture Digital Notes....pdf
PPTX
"Array and Linked List in Data Structures with Types, Operations, Implementat...
PPTX
tack Data Structure with Array and Linked List Implementation, Push and Pop O...
Graph Data Structures with Types, Traversals, Connectivity, and Real-Life App...
20250617 - IR - Global Guide for HR - 51 pages.pdf
MAD Unit - 3 User Interface and Data Management (Diploma IT)
LOW POWER CLASS AB SI POWER AMPLIFIER FOR WIRELESS MEDICAL SENSOR NETWORK
Unit1 - AIML Chapter 1 concept and ethics
MLpara ingenieira CIVIL, meca Y AMBIENTAL
distributed database system" (DDBS) is often used to refer to both the distri...
Applications of Equal_Area_Criterion.pdf
ASME PCC-02 TRAINING -DESKTOP-NLE5HNP.pptx
August -2025_Top10 Read_Articles_ijait.pdf
AUTOMOTIVE ENGINE MANAGEMENT (MECHATRONICS).pptx
Design of Material Handling Equipment Lecture Note
First part_B-Image Processing - 1 of 2).pdf
Chapter 1 - Introduction to Manufacturing Technology_2.ppt
Present and Future of Systems Engineering: Air Combat Systems
wireless networks, mobile computing.pptx
Module 8- Technological and Communication Skills.pptx
Computer organization and architecuture Digital Notes....pdf
"Array and Linked List in Data Structures with Types, Operations, Implementat...
tack Data Structure with Array and Linked List Implementation, Push and Pop O...

Crossing platforms with JavaScript & React

  • 4. Web
  • 6. iOS
  • 10. What is cross platform JS?
  • 11. JS that can run on more than one platform
  • 13. “Why did the iOS team implement it like this?”
  • 14. “The Android app currently doesn’t support that”
  • 16. Easier to share code across many teams
  • 17. More team collaboration since there’s more overlap
  • 18. It allows teams to own products & not be separated by technology
  • 19. TL;DR your team now owns the iOS, Android, and (maybe) web apps.
  • 22. If you can build iOS & Android apps in the same code base it should be cheaper
  • 23. Why not bet on the web?
  • 24. Native will be better than mobile web for a while
  • 25. Why not take the web tooling & get native results?
  • 26. You are betting on the web
  • 27. Can’t beat them, join them
  • 28. I decided to be ambitious
  • 29. Build an Instagram clone for Web, iOS, & Android
  • 31. Use Impagination.js to power an Infinite scroll of images
  • 33. Impagination will work on any JS codebase
  • 34. Building infinite scroll in React Native with Impagination http://bit.ly/reactnativeinfinitescroll
  • 35. We’ve already used Impagination in four different platforms
  • 36. What else can be shared?
  • 39. Three phases to the experiment • Planning • Implementation • Postmortem
  • 42. 🥞The stack🥞 • React Native • React (DOM) • Auth0 (authentication) • Graph.cool (backend) • Impagination (infinite datasets)
  • 43. What should the app do? • Login / Sign up • See your profile & images you’ve posted • Edit your profile • Post a new photo • Main list feed showing everyones posts
  • 48. Start to build the native app
  • 49. Realize I’ve already solved these problems in the web app
  • 52. ListPage.js handles both UI & data right now
  • 53. ListPage for native duplicates a lot form web ListPage
  • 54. class ListPage extends React.Component { static propTypes = { data: React.PropTypes.object, } state = { dataset: null, datasetState: null, } setupImpagination() {} componentWillMount() {this.setupImpagination();} setCurrentReadOffset = (event) => {} render () { return ( <div style={{maxWidth: "600px", margin: "0 auto", padding: "20px 0"}}> <Infinite elementHeight={ITEM_HEIGHT} handleScroll={this.setCurrentReadOffset} useWindowAsScrollContainer> {this.state.datasetState.map(record => { if (record.isPending && !record.isSettled) { return <LoadingPost key={Math.random()} />; } return <Photo key={record.content.id} photo={record.content} user={record.content.user} />; })} </Infinite> </div> ); } } const FeedQuery = gql`query($skip: Int!, $first: Int!) { allPhotos(orderBy: createdAt_DESC, first: $first, skip: $skip) { } }`; export default graphql(FeedQuery, {options: {variables: { skip: 0, first: PAGE_SIZE }}})(ListPage); Web ListPage.js
  • 55. ` class ListPage extends React.Component { static propTypes = { data: React.PropTypes.object, } state = { dataset: null, datasetState: null, } setupImpagination() {} componentWillMount() {this.setupImpagination();} setCurrentReadOffset = (event) => {} render () { return ( <ScrollView style={{flex: 1}} scrollEventThrottle={300} onScroll={this.setCurrentReadOffset} removeClippedSubviews={true}> {this.state.datasetState.map(record => { if(record.isPending && !record.isSettled) { return <LoadingPost key={Math.random()}/>; } return <Photo key={record.content.id} photo={record.content} user={record.content.user} />; })} </ScrollView> ); } } const FeedQuery = gql`query($skip: Int!, $first: Int!) { allPhotos(orderBy: createdAt_DESC, first: $first, skip: $skip) { } }`; export default graphql(FeedQuery, {options: {variables: { skip: 0, first: PAGE_SIZE }}})(ListPage); Native ListPage.js
  • 56. Everything but the UI is the same
  • 59. <IndexRoute component={ListPageContainer} /> <Route path='feed' component={ListPageContainer} />
  • 60. import ListPageView from ‘../components/presentational/ListPageView’; class ListPageContainer extends React.Component { state = { dataset: null, datasetState: null, } setupImpagination() {} componentWillMount() {this.setupImpagination();} setCurrentReadOffset = (event) => {} render () { return ( <ListPageView setCurrentReadOffset={this.setCurrentReadOffset} datasetState={this.state.datasetState} />; ); } } const FeedQuery = gql`query($skip: Int!, $first: Int!) { allPhotos(orderBy: createdAt_DESC, first: $first, skip: $skip) { } }`; export default graphql(FeedQuery, {options: {variables: { skip: 0, first: PAGE_SIZE }}})(ListPage);
  • 61. Make the container component render a separate presentation component
  • 62. Leave setting the readOffset to the presentation components
  • 63. setCurrentReadOffset function is passed as a prop from the container component
  • 64. t import React, { Component } from 'react'; import Infinite from 'react-infinite'; import Photo from '../presentational/Photo'; import LoadingPost from '../presentational/LoadingPost'; const ITEM_HEIGHT = 600; const HEADER_HEIGHT = 80; class ListPageView extends Component { setCurrentReadOffset = (event) => { let currentItemIndex = Math.ceil((window.scrollY - HEADER_HEIGHT) / ITEM_HEIGHT); this.props.setCurrentReadOffset(currentItemIndex); } render() { return ( <div style={{maxWidth: "600px", margin: "0 auto", padding: "20px 0"}}> <Infinite elementHeight={ITEM_HEIGHT} handleScroll={this.setCurrentReadOffset} useWindowAsScrollContainer> {this.props.datasetState.map(record => { if (record.isPending && !record.isSettled) { return <LoadingPost key={Math.random()} />; } return <Photo key={record.content.id} photo={record.content} user={record.content.user} />; })} </Infinite> </div> ); } } export default ListPageView; Web presentation component
  • 65. Native presentation component import React, { Component } from 'react'; import Photo from '../presentational/Photo'; import LoadingPost from '../presentational/LoadingPost'; import { ScrollView } from 'react-native'; const ITEM_HEIGHT = 485; class ListPageView extends Component { setCurrentReadOffset = (event) => { let currentOffset = Math.floor(event.nativeEvent.contentOffset.y); let currentItemIndex = Math.ceil(currentOffset / ITEM_HEIGHT); this.props.setCurrentReadOffset(currentItemIndex); } render() { return ( <ScrollView style={{flex: 1}} scrollEventThrottle={300} onScroll={this.setCurrentReadOffset} removeClippedSubviews={true}> {this.props.datasetState.map(record => { if(record.isPending && !record.isSettled) { return <LoadingPost key={Math.random()}/>; } return <Photo key={record.content.id} photo={record.content} user={record.content.user} />; })} </ScrollView> ); } } export default ListPageView;
  • 66. This theme continues throughout the entire app
  • 67. <IndexRoute component={ListPageContainer} /> <Route path='feed' component={ListPageContainer} /> <Route path='new' component={CreatePostContainer} onEnter={this.requireAuth.bind(this)} /> <Route path='signup' component={CreateUserContainer} /> <Route path='profile' component={UserProfileContainer} > <IndexRoute component={UserProfileContainer} /> <Route path='edit' component={EditProfileContainer} /> </Route> <Route path='logout' component={() => <Logout logout={this.handleToken.bind(this)} /> } />
  • 70. Building the apps in time was hard…
  • 73. Figuring out what code is shareable
  • 74. Figuring out how to make that code shareable
  • 75. React Router is neat & works cross platform There are different imports for React Native & React
  • 77. Auth0 was very easy to implement on both platforms. There are different APIs for React Native & React
  • 79. What all ended up being shared?
  • 80. ✅ List feed ✅ User profile ✅ Edit user profile ✅ Sign up ✅ New post
  • 81. Beyond login mostly everything else is the same
  • 82. The UI changed but not the business logic
  • 84. We’re in a post DOM world
  • 86. The UI framework will change but the underlying model driving it won’t
  • 88. We get stronger libraries by increasing the number of users & contributors.
  • 89. React makes this very easy thanks to React & React Native
  • 90. I was able to share the same five container components across three different platforms
  • 91. Write one container component and many UI components
  • 92. The core of this app is shared
  • 93. That’s a cost savings
  • 94. I own this entire product & its 3 platforms
  • 95. In 2 weeks I was able do all of this
  • 97. Instagram also agrees with me https://engineering.instagram.com/react-native-at-instagram- dd828a9a90c7#.i364vchox
  • 99. If this kind of stuff interests you