SlideShare a Scribd company logo
Hands on: React Native
By Er.Jay Nagar
www.jaynagarblog.wordpress.com
About me:
: Diploma in IT, BE In IT
● Technology: PHP,JS,HTML,CSS
● Community: GDG , Mozilla , GirlScript
Agenda
● RN introduction
● Brief about technologies it depends on (JSX, ES6)
● Environment setup & RN cli
● Components
● Component lifecycle
● Basic and custom components
● API integration & Navigation
www.jaynagarblog.wordpress.com
Code and output
$ git clone https://github.com/sagark1510/RNHandsOn
$ cd RNHandsOn
$ npm install
$ react-native run-android
$ git checkout fbf8d19
www.jaynagarblog.wordpress.com
What is React Native?
RN is framework for building mobile apps using ReactJs & Javascript
Builds cross-platform mobile apps
Uses most of all the ReactJs features
www.jaynagarblog.wordpress.com
Why I should learn React Native?
1. You can start RN app dev in no time if you already know ReactJS
2. 80% code is common
3. Less expensive / Cost effective
4. Easier to code and scale
5. Save massive amount of time
1. Hybrid is more like hack than a solution
2. Performance was biggest issue in Hybrid
3. Debugging is faster than ever compare to native
4. No need to recompile for every change as native
React Native vs Hybrid Apps vs Native Apps
www.jaynagarblog.wordpress.com
ES6
Features of ES6
1. Classes
2. Arrows function
3. Template string
4. Object and Array destructuring
5. Let & Const
6. Modules import, export
7. Promise
https://github.com/DrkSephy/es6-cheatsheet
www.jaynagarblog.wordpress.com
React Native environment setup
Environment setup guide:
https://facebook.github.io/react-native/docs/getting-started.html
www.jaynagarblog.wordpress.com
Create your first project
1. $ npm install -g react-native-cli
2. $ react-native init RNHandsOn
3. $ cd RNHandsOn
4. $ react-native run-android
Or
$ react-native run-ios
Project folder structure
Index
Package.json
Android
iOS
www.jaynagarblog.wordpress.com
JSX
Let see how it works
https://babeljs.io/repl/
What is component?
● Everything what you see in RN app is
component.
● It’s a reusable piece of code
Component life cycle
Mounting
Lifecycle
● constructor(props)
● componentWillMount()
● render()
● componentDidMount()
Updating Lifecycle
● componentWillReceiveProps()
● shouldComponentUpdate()
● componentWillUpdate()
● render()
● componentDidUpdate()
Basic components of React Native
● View
● Text
● Image
● TextInput
● Touchables/Button
● ScrollView
$ git checkout ab77077
What is Props in React Component?
www.jaynagarblog.wordpress.com
What is State in React Component?
● Two type of data
controls component
Props & State
● Props are controlled
by parent component
● State is used to
change internal UI/
Data of the
component
Counter example for State demonstration.
$ git checkout c494ae8
www.jaynagarblog.wordpress.com
Debugging in RN
Styling in React Native Component
● Built in component has
STYLE attribute.
● Style can be inline or
external object
● Use StyleSheet.create
Style - Flexbox
● What is FlexBox
● Let’s make a layout using FlexBox
$ git checkout c9a2b6a
www.jaynagarblog.wordpress.com
Custom Component
Smart Component
● “C” of “MVC” architecture.
● It is also known as
Containers
● It handles how thing works
● Does the data fetching and
Provides application data &
handle events / actions
Dumb Component
● “V” of “MVC” architecture.
● It is also known as stateless
component
● It handles how things looks
● It has only props, callbacks
which are provided by smart
component
www.jaynagarblog.wordpress.com
Example of Custom Components
Dumb Component Smart Component
Navigation in React Native
$npm install --save react-navigation
Login example
Example of Login using React Navigation and AsyncStorage.
$ git checkout a7bd54e
$ git checkout 95dbd39
www.jaynagarblog.wordpress.com
Working with Remote data - Fetch API
● Fetch API gives the
global fetch method for
accessing and
manipulating parts of
HTTP pipeline.
● Earlier we were using
XMLHttpRequest for
AJAX calls but this new
Fetch api will replace it
soon all over.
FlatList with static & Dynamic content example
$ git checkout 169e7c6
www.jaynagarblog.wordpress.com
Any Question?
THANK YOU :)

More Related Content

PDF
Putting the Native in React Native - React Native Boston
PDF
React Native - Getting Started
PDF
Intro To React Native
PDF
React Native in a nutshell
PDF
Intro to react native
PDF
Introduction to react native
PDF
Getting Started with React Native (and should I use it at all?)
PDF
Optimizing React Native views for pre-animation
Putting the Native in React Native - React Native Boston
React Native - Getting Started
Intro To React Native
React Native in a nutshell
Intro to react native
Introduction to react native
Getting Started with React Native (and should I use it at all?)
Optimizing React Native views for pre-animation

What's hot (20)

PDF
Introduction to React Native
PDF
React Native for multi-platform mobile applications - Matteo Manchi - Codemo...
PDF
Introduction to React Native
PPTX
Creating books app with react native
PPTX
Introduction to React Native
PDF
Introduction to React Native & Rendering Charts / Graphs
PPTX
React Native for ReactJS Devs
PDF
A tour of React Native
PDF
Introduction to React Native
PDF
Lo mejor y peor de React Native @ValenciaJS
PDF
What's This React Native Thing I Keep Hearing About?
PDF
Experiences building apps with React Native @DomCode 2016
PDF
From zero to hero with React Native!
PDF
An iOS Developer's Perspective on React Native
PDF
When to (use / not use) React Native.
PPTX
React native - React(ive) Way To Build Native Mobile Apps
PDF
Introduction to React Native
PDF
React native
PDF
Some experiences building an Android app with React Native & Redux
PPTX
React Native - Unleash the power of React in your device - Eduard Tomàs - Cod...
Introduction to React Native
React Native for multi-platform mobile applications - Matteo Manchi - Codemo...
Introduction to React Native
Creating books app with react native
Introduction to React Native
Introduction to React Native & Rendering Charts / Graphs
React Native for ReactJS Devs
A tour of React Native
Introduction to React Native
Lo mejor y peor de React Native @ValenciaJS
What's This React Native Thing I Keep Hearing About?
Experiences building apps with React Native @DomCode 2016
From zero to hero with React Native!
An iOS Developer's Perspective on React Native
When to (use / not use) React Native.
React native - React(ive) Way To Build Native Mobile Apps
Introduction to React Native
React native
Some experiences building an Android app with React Native & Redux
React Native - Unleash the power of React in your device - Eduard Tomàs - Cod...
Ad

Similar to Hands on react native (20)

PPTX
Introduction to react native @ TIC NUST
PPTX
20180518 QNAP Seminar - Introduction to React Native
PPTX
React native introduction (Mobile Warsaw)
PPTX
Web summit.pptx
PPTX
Creating a reasonable project boilerplate
PDF
Deploy 22 microservices from scratch in 30 mins with GitOps
PDF
Angular (v2 and up) - Morning to understand - Linagora
PDF
Philip Shurpik "Architecting React Native app"
PDF
React fristy day learn basic NM_Day01.pdf
PPTX
Introduction to React Native
PDF
Integrating react in django while staying sane and happy
PDF
"Crafting a Third-Party Banking Library with Web Components and React", Germa...
PDF
Full Stack React Workshop [CSSC x GDSC]
PPTX
From React to React Native - Things I wish I knew when I started
PDF
Pluggable web app using Angular (Odessa JS conf)
PPTX
Angular elements - embed your angular components EVERYWHERE
PDF
Client vs Server Templating: Speed up initial load for SPA with Angular as an...
PDF
React - The JavaScript Library for User Interfaces
PDF
Google app-engine-with-python
PPTX
React native
Introduction to react native @ TIC NUST
20180518 QNAP Seminar - Introduction to React Native
React native introduction (Mobile Warsaw)
Web summit.pptx
Creating a reasonable project boilerplate
Deploy 22 microservices from scratch in 30 mins with GitOps
Angular (v2 and up) - Morning to understand - Linagora
Philip Shurpik "Architecting React Native app"
React fristy day learn basic NM_Day01.pdf
Introduction to React Native
Integrating react in django while staying sane and happy
"Crafting a Third-Party Banking Library with Web Components and React", Germa...
Full Stack React Workshop [CSSC x GDSC]
From React to React Native - Things I wish I knew when I started
Pluggable web app using Angular (Odessa JS conf)
Angular elements - embed your angular components EVERYWHERE
Client vs Server Templating: Speed up initial load for SPA with Angular as an...
React - The JavaScript Library for User Interfaces
Google app-engine-with-python
React native
Ad

More from Jay Nagar (20)

PPTX
11 best tips to grow your influence youtube
PPTX
Impact of micro vs macro influencers in 2022
PPTX
What is Signature marketing
PDF
100+ Guest blogging sites list
PPTX
Ethical Hacking and Defense Penetration
PDF
Cyber Security and Cyber Awareness Tips manual 2020
PPTX
On-Page SEO Techniques By Digitech Jay
PPTX
Artificial Intelligence
PPT
Cyber Security and Cyber Awareness
PDF
Cyber security and Privacy Awareness manual
PDF
Dynamic programming
PPTX
Bluethooth Protocol stack/layers
PPTX
GPRS(General Packet Radio Service)
PPTX
Communication and Networking
PPTX
MOBILE COMPUTING and WIRELESS COMMUNICATION
PPT
Global system for mobile communication(GSM)
PPTX
Python for beginners
DOCX
Earn Money from bug bounty
PPTX
Code smell & refactoring
PPT
The Diffie-Hellman Algorithm
11 best tips to grow your influence youtube
Impact of micro vs macro influencers in 2022
What is Signature marketing
100+ Guest blogging sites list
Ethical Hacking and Defense Penetration
Cyber Security and Cyber Awareness Tips manual 2020
On-Page SEO Techniques By Digitech Jay
Artificial Intelligence
Cyber Security and Cyber Awareness
Cyber security and Privacy Awareness manual
Dynamic programming
Bluethooth Protocol stack/layers
GPRS(General Packet Radio Service)
Communication and Networking
MOBILE COMPUTING and WIRELESS COMMUNICATION
Global system for mobile communication(GSM)
Python for beginners
Earn Money from bug bounty
Code smell & refactoring
The Diffie-Hellman Algorithm

Recently uploaded (9)

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

Hands on react native

  • 1. Hands on: React Native By Er.Jay Nagar www.jaynagarblog.wordpress.com
  • 2. About me: : Diploma in IT, BE In IT ● Technology: PHP,JS,HTML,CSS ● Community: GDG , Mozilla , GirlScript
  • 3. Agenda ● RN introduction ● Brief about technologies it depends on (JSX, ES6) ● Environment setup & RN cli ● Components ● Component lifecycle ● Basic and custom components ● API integration & Navigation www.jaynagarblog.wordpress.com
  • 4. Code and output $ git clone https://github.com/sagark1510/RNHandsOn $ cd RNHandsOn $ npm install $ react-native run-android $ git checkout fbf8d19 www.jaynagarblog.wordpress.com
  • 5. What is React Native? RN is framework for building mobile apps using ReactJs & Javascript Builds cross-platform mobile apps Uses most of all the ReactJs features www.jaynagarblog.wordpress.com
  • 6. Why I should learn React Native? 1. You can start RN app dev in no time if you already know ReactJS 2. 80% code is common 3. Less expensive / Cost effective 4. Easier to code and scale 5. Save massive amount of time
  • 7. 1. Hybrid is more like hack than a solution 2. Performance was biggest issue in Hybrid 3. Debugging is faster than ever compare to native 4. No need to recompile for every change as native React Native vs Hybrid Apps vs Native Apps www.jaynagarblog.wordpress.com
  • 8. ES6 Features of ES6 1. Classes 2. Arrows function 3. Template string 4. Object and Array destructuring 5. Let & Const 6. Modules import, export 7. Promise https://github.com/DrkSephy/es6-cheatsheet www.jaynagarblog.wordpress.com
  • 9. React Native environment setup Environment setup guide: https://facebook.github.io/react-native/docs/getting-started.html www.jaynagarblog.wordpress.com
  • 10. Create your first project 1. $ npm install -g react-native-cli 2. $ react-native init RNHandsOn 3. $ cd RNHandsOn 4. $ react-native run-android Or $ react-native run-ios
  • 12. JSX Let see how it works https://babeljs.io/repl/
  • 13. What is component? ● Everything what you see in RN app is component. ● It’s a reusable piece of code
  • 14. Component life cycle Mounting Lifecycle ● constructor(props) ● componentWillMount() ● render() ● componentDidMount() Updating Lifecycle ● componentWillReceiveProps() ● shouldComponentUpdate() ● componentWillUpdate() ● render() ● componentDidUpdate()
  • 15. Basic components of React Native ● View ● Text ● Image ● TextInput ● Touchables/Button ● ScrollView $ git checkout ab77077
  • 16. What is Props in React Component? www.jaynagarblog.wordpress.com
  • 17. What is State in React Component? ● Two type of data controls component Props & State ● Props are controlled by parent component ● State is used to change internal UI/ Data of the component
  • 18. Counter example for State demonstration. $ git checkout c494ae8 www.jaynagarblog.wordpress.com
  • 20. Styling in React Native Component ● Built in component has STYLE attribute. ● Style can be inline or external object ● Use StyleSheet.create
  • 21. Style - Flexbox ● What is FlexBox ● Let’s make a layout using FlexBox $ git checkout c9a2b6a www.jaynagarblog.wordpress.com
  • 22. Custom Component Smart Component ● “C” of “MVC” architecture. ● It is also known as Containers ● It handles how thing works ● Does the data fetching and Provides application data & handle events / actions Dumb Component ● “V” of “MVC” architecture. ● It is also known as stateless component ● It handles how things looks ● It has only props, callbacks which are provided by smart component www.jaynagarblog.wordpress.com
  • 23. Example of Custom Components Dumb Component Smart Component
  • 24. Navigation in React Native $npm install --save react-navigation
  • 25. Login example Example of Login using React Navigation and AsyncStorage. $ git checkout a7bd54e $ git checkout 95dbd39 www.jaynagarblog.wordpress.com
  • 26. Working with Remote data - Fetch API ● Fetch API gives the global fetch method for accessing and manipulating parts of HTTP pipeline. ● Earlier we were using XMLHttpRequest for AJAX calls but this new Fetch api will replace it soon all over.
  • 27. FlatList with static & Dynamic content example $ git checkout 169e7c6 www.jaynagarblog.wordpress.com