SlideShare une entreprise Scribd logo
1  sur  46
Télécharger pour lire hors ligne
React Native
The Development Flow
@ritz078
Ritesh Kumar
Lead SDE, Anarock
😥
Intro
• Let’s us build mobile application
• Same Design as React
• True Native Behaviour
NativeScript
“write once, use everywhere.”
React Native
“learn once, write everywhere”
Apps built using RN
react-native init myapp
cd myapp
yarn
yarn build
yarn start
Getting started
Development
Type Checking
https://transform.now.sh
Automate It
UI Development
react-storybook
•Isolated UI Development
•Faster updates while
development
•Snapshot testing using
storyshots.
import React from "react";
import { storiesOf } from "@storybook/react-native";
import CenterView from "./CenterView";
import Button from "components/GenericButton";
import colors from "utilities/colors";
storiesOf("GenericButton", module)
.addDecorator(getStory "=> <CenterView>{getStory()}"</CenterView>)
.add("Default", () "=> [
<Button title={"Hello"} key={1} "/>,
<Button title={"Hello"} key={2} color={colors.red} "/>,
<Button title={"Hello"} key={2.1} color={colors.red} disabled "/>,
<Button title={"Hello"} key={3} filled "/>,
<Button title={"Hello"} key={3.1} filled disabled "/>,
<Button title={"Hello"} key={4} iconName={"update"} "/>
]);
"// .add ("Another Configuration", () "=>
"// <Button "/>
)
Isolated UI Development
•Decoupled from the app architecture
•Developed like a library
•Easier testing
•Maintainable
Images
<Image source={require('./my-icon.png')} "/>
├── my-icon@2x.png
└── my-icon@3x.png
React Native will automatically look for the suitable
resolution with that file name
Different Pixel Densities
Different Image Resolutions
Use SVGs
• Use react-native-svg
• Optimize svg using something
like svgo
<svg
xmlns="http:"//""www.w3.org/2000/svg"
width=“200"
height="100"
version="1.1"
>
<rect
width="200"
height="100"
stroke="black"
stroke-width="6"
fill="green"
"/>
"</svg>
import
Svg,
{ Rect }
from "react-native-svg"
export default function() {
return (
<Svg width={200} height={100}>
<Rect
width={200}
height={100}
stroke="#000"
strokeWidth={6}
fill="green"
"/>
"</Svg>
)
}
HTML Code React Native Code
https://transform.now.sh/svg-to-react-native
Automate It
40-50% size reduction on replacing png with SVG
Performance
InteractionManager.runAfterInteractions
InteractionManager.runAfterInteractions(() "=> {
"// ""...long-running synchronous task""...
});
Runs code after the current animations have finished
requestAnimationFrame
requestAnimationFrame(() "=> {
"// ""...task""...
});
• Runs code before next repaint
• If you are using Animated API, it takes care of the frame
updates for you.
InteractionManager.runAfterInteractions(() "=> {
"// ""...long-running synchronous task""...
});
requestAnimationFrame(() "=> {
"// ""...task""...
});
VS
Long Lists
•Don’t use ScrollView
•Use FlatList or SectionList
•They use VirtualizedList internally
Debugging
Open DevtoolsRefresh on file Change
Update Changed Code
Inspect components &
Touchable areas
FPS Monitor
Better Debugging (Inspect + Devtools + Redux)
react-native-debugger
•Use default debugger unless it isn’t useful. It’s fast
•Turn off network monitoring if you don’t need it
Live Reload
• Reloads the entire page.
• State is lost.
• Updates the changed code.
• State is not lost.
Hot Reloading
Debugging on Device
adb shell input keyevent 82
Dev Mode
Tap multiple times to enable
dev mode
import * as Rx from “rxjs";
this.devModeStream = new Rx.Subject();
this.devModeStream
.bufferWhen(() "=> this.devModeStream.debounceTime(1000))
.filter(x "=> x.length ">= 6)
.subscribe(this.toggleDevMode);
Create a stream
import * as Rx from “rxjs";
this.devModeStream = new Rx.Subject();
this.devModeStream
.bufferWhen(() "=> this.devModeStream.debounceTime(1000))
.filter(x "=> x.length ">= 6)
.subscribe(this.toggleDevMode);
onClick this.devModeStream.next(event);
Releases
beta
beta_native
master
JS only changes
Native + JS Changes
Codepush
Play Store
2.1.x
2.x.0
Minor (2.5.x)
Major (2.6.0)
All PRs that will go in
CodePush Update
Native release
Beta
Beta
Native
Release Cycle
Native OTA
Fortnightly Bug Fixes - Instantly
Features - Weekly
Keep in mind
"react-native-image-picker": "^0.26.7"
Don’t do this or your OTA might break your app.
Expo
Getting Started
Scan a QR code
Open a Link
Online expo editor
https://snack.expo.io/
Native Features
Thank You
@ritz078

Contenu connexe

Tendances

SharePoint Framework, Angular and Azure Functions
SharePoint Framework, Angular and Azure FunctionsSharePoint Framework, Angular and Azure Functions
SharePoint Framework, Angular and Azure Functions
Sébastien Levert
 

Tendances (20)

Setting Apple's UI Automation Free with Appium
Setting Apple's UI Automation Free with AppiumSetting Apple's UI Automation Free with Appium
Setting Apple's UI Automation Free with Appium
 
Setting UIAutomation free with Appium
Setting UIAutomation free with AppiumSetting UIAutomation free with Appium
Setting UIAutomation free with Appium
 
Ember testing internals with ember cli
Ember testing internals with ember cliEmber testing internals with ember cli
Ember testing internals with ember cli
 
Nodejs Intro Part One
Nodejs Intro Part OneNodejs Intro Part One
Nodejs Intro Part One
 
Workshop 15: Ionic framework
Workshop 15: Ionic frameworkWorkshop 15: Ionic framework
Workshop 15: Ionic framework
 
Nodejs Intro - Part2 Introduction to Web Applications
Nodejs Intro - Part2 Introduction to Web ApplicationsNodejs Intro - Part2 Introduction to Web Applications
Nodejs Intro - Part2 Introduction to Web Applications
 
Web workers
Web workersWeb workers
Web workers
 
JavaScript Web Workers
JavaScript Web WorkersJavaScript Web Workers
JavaScript Web Workers
 
Testing Ember Apps: Managing Dependency
Testing Ember Apps: Managing DependencyTesting Ember Apps: Managing Dependency
Testing Ember Apps: Managing Dependency
 
UI Testing Best Practices - An Expected Journey
UI Testing Best Practices - An Expected JourneyUI Testing Best Practices - An Expected Journey
UI Testing Best Practices - An Expected Journey
 
Test like a pro with Ember.js
Test like a pro with Ember.jsTest like a pro with Ember.js
Test like a pro with Ember.js
 
Testing frontends with nightwatch & saucelabs
Testing frontends with nightwatch & saucelabsTesting frontends with nightwatch & saucelabs
Testing frontends with nightwatch & saucelabs
 
Introduction to Retrofit
Introduction to RetrofitIntroduction to Retrofit
Introduction to Retrofit
 
Jquery- One slide completing all JQuery
Jquery- One slide completing all JQueryJquery- One slide completing all JQuery
Jquery- One slide completing all JQuery
 
Zepto and the rise of the JavaScript Micro-Frameworks
Zepto and the rise of the JavaScript Micro-FrameworksZepto and the rise of the JavaScript Micro-Frameworks
Zepto and the rise of the JavaScript Micro-Frameworks
 
Protractor end-to-end testing framework for angular js
Protractor   end-to-end testing framework for angular jsProtractor   end-to-end testing framework for angular js
Protractor end-to-end testing framework for angular js
 
SharePoint Framework, Angular and Azure Functions
SharePoint Framework, Angular and Azure FunctionsSharePoint Framework, Angular and Azure Functions
SharePoint Framework, Angular and Azure Functions
 
Join the darkside: Selenium testing with Nightwatch.js
Join the darkside: Selenium testing with Nightwatch.jsJoin the darkside: Selenium testing with Nightwatch.js
Join the darkside: Selenium testing with Nightwatch.js
 
Carmen Popoviciu - Protractor styleguide | Codemotion Milan 2015
Carmen Popoviciu - Protractor styleguide | Codemotion Milan 2015Carmen Popoviciu - Protractor styleguide | Codemotion Milan 2015
Carmen Popoviciu - Protractor styleguide | Codemotion Milan 2015
 
Puppeteer - Headless Chrome Node API
Puppeteer - Headless Chrome Node APIPuppeteer - Headless Chrome Node API
Puppeteer - Headless Chrome Node API
 

Similaire à React Native: The Development Flow

iOS app dev Training - Session1
iOS app dev Training - Session1iOS app dev Training - Session1
iOS app dev Training - Session1
Hussain Behestee
 

Similaire à React Native: The Development Flow (20)

React nativebeginner1
React nativebeginner1React nativebeginner1
React nativebeginner1
 
Introduction to React native
Introduction to React nativeIntroduction to React native
Introduction to React native
 
From MEAN to the MERN Stack
From MEAN to the MERN StackFrom MEAN to the MERN Stack
From MEAN to the MERN Stack
 
An iOS Developer's Perspective on React Native
An iOS Developer's Perspective on React NativeAn iOS Developer's Perspective on React Native
An iOS Developer's Perspective on React Native
 
React Native
React NativeReact Native
React Native
 
React Native: Introduction
React Native: IntroductionReact Native: Introduction
React Native: Introduction
 
Mobile developer is Software developer
Mobile developer is Software developerMobile developer is Software developer
Mobile developer is Software developer
 
Native script overview
Native script overviewNative script overview
Native script overview
 
Protractor Tutorial Quality in Agile 2015
Protractor Tutorial Quality in Agile 2015Protractor Tutorial Quality in Agile 2015
Protractor Tutorial Quality in Agile 2015
 
Intro to appcelerator
Intro to appceleratorIntro to appcelerator
Intro to appcelerator
 
Testing Ext JS and Sencha Touch
Testing Ext JS and Sencha TouchTesting Ext JS and Sencha Touch
Testing Ext JS and Sencha Touch
 
Kirin - Making Single Page Web Apps with a Native UI
Kirin - Making Single Page Web Apps with a Native UIKirin - Making Single Page Web Apps with a Native UI
Kirin - Making Single Page Web Apps with a Native UI
 
React && React Native workshop
React && React Native workshopReact && React Native workshop
React && React Native workshop
 
Drupal 7 ci and testing
Drupal 7 ci and testingDrupal 7 ci and testing
Drupal 7 ci and testing
 
React Native
React NativeReact Native
React Native
 
Being Epic: Best Practices for Android Development
Being Epic: Best Practices for Android DevelopmentBeing Epic: Best Practices for Android Development
Being Epic: Best Practices for Android Development
 
iOS app dev Training - Session1
iOS app dev Training - Session1iOS app dev Training - Session1
iOS app dev Training - Session1
 
NativeScript: Cross-Platform Mobile Apps with JavaScript and Angular
NativeScript: Cross-Platform Mobile Apps with JavaScript and AngularNativeScript: Cross-Platform Mobile Apps with JavaScript and Angular
NativeScript: Cross-Platform Mobile Apps with JavaScript and Angular
 
React Native - DILo Surabaya
React Native -  DILo SurabayaReact Native -  DILo Surabaya
React Native - DILo Surabaya
 
20180518 QNAP Seminar - Introduction to React Native
20180518 QNAP Seminar - Introduction to React Native20180518 QNAP Seminar - Introduction to React Native
20180518 QNAP Seminar - Introduction to React Native
 

Dernier

Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Dr.Costas Sachpazis
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
ankushspencer015
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Christo Ananth
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
 

Dernier (20)

Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTINGMANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
 
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur EscortsRussian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 

React Native: The Development Flow