React Native allows developers to write mobile apps using React and share common code between Android and iOS. The document discusses building basic components in React Native, passing props between components, styling components, tracking events natively, debugging challenges, and managing shared code in a monorepo. It concludes that React Native has a low barrier to entry given the popularity of React, provides a native-like experience, and improves developer velocity by enabling write once, run anywhere code sharing across platforms.
7. StackOverflow Official Developer
Survey 2017
https://insights.stackoverflow.com/survey/2017
72% of respondents labelled themselves as
Web Developers (23% mobile developers)
Javascript is the most popular language for
the 5th year in a row
React is the most loved technology of 2017
24. Our Conclusion
Low barrier for entry (we have heaps of React devs)
Better than a webview - “I can’t believe it’s not Native”
You don’t have to commit to using React Native
Developer Velocity - Write once run everywhere...
25. Future of RN - React as a platform
React Primitives - Web + Mobile + VR
Codepush
Further development of native components
26. React Native: Bringing modern web techniques to mobile (Facebook)
Powering UberEats with React Native and Uber Engineering
Leland Richardson - React Native in the "Brown Field" - React Conf 2017
How Airbnb Is Using React Native
React Native at Instagram
create-react-native-app
Try it out now - https://expo.io/
Useful Resources
React = a js library for building user interfaces: component based,
React - 2013
RN - 2015
Write Once, run anywhere - Sun microsystems 1996 on Java
Previous attempts at x platform development have mostly been webviews
Predominantly renders into a webview (with the exception of Xamarin)
Establish definition of brownfield vs greenfield
Greenfield apps - Uber Eats
Instagram + Airbnb
If you have interacted with these screens then you have used React Native
After this we were curious to understand the technology
Over 64,000 respondents
Javascript’s 5th year in a row at number 1 (select all that apply)
Java is high (3rd after SQL)
Swift vs Obj C is pretty even
No Kotlin :(
Taking a skeptical approach
Real estate Agents like to see their faces
Single Page showing agent profile information
Would have traditionally used a webview
Good use case
Relatively low traffic (we have existing stats on this)
Images, text, lists of property listings
Currently able to send enquiry or phone
JSX is a preprocessor step that adds XML syntax to JavaScript.
The props is the agentId
We want our native apps to render this
Agent React Activity - extends ReactActivity
AgentViewController.swift
Different styles?
Platform specific styling
Domain is data driven
We want to maintain our google analytics session - don’t break the flow
In order to do this we want the react component to communicate back to each native app
Native Bridge (Tracking)
Shows how to define ReactMethods - extends ReactContextBaseJavaModule
Links in with existing tracking
SafeModule
App flow is uninterrupted (analytics)
Also catches errors in Fabric
Android Images use fresco under the hood
Flatlist issues
Native devs had to JS / JS devs had to learn native ecosystems to a minor degree
Single NPM module
Centralised repo - minimal JS in the native codebases
In the package.json
Native PR is only a version number increase
Separate Demo App - allows React developers to work away from the Native codebases
Debugging is possible here
Hot reloading + live reload - no recompiling here
Ultimately RN is rendered natively
Good for atomic single uses i.e. low-traffic screen
Don’t have to go all in!
With our monorepo react devs can work on it without interfering with the native teams
React Primitives - This library attempts to propose an ideal set of primitives around building React applications, regardless of Platform.
Codepush - is a cloud service that enables Cordova and React Native developers to deploy mobile app updates directly to their users’ devices. It works by acting as a central repository that developers can publish certain updates to (e.g. JS, HTML, CSS and image changes), and that apps can query for updates from (using our provided client SDKs).