SlideShare a Scribd company logo
Rami Sayar - @ramisayar
Senior Technical Evangelist
Microsoft Canada
@RAMISAYAR
@RAMISAYAR
@RAMISAYAR
@RAMISAYAR
• Introduction to React
• Introduction to React Native
• Building Apps with Flexbox
• Using the List View
• Builtin Components
• Demo Walkthrough
• Tools
@RAMISAYAR
Assumption: JavaScript Developer
@RAMISAYAR
@RAMISAYAR
• React is a UI *library* developed at Facebook.
• Lets you create interactive, stateful & reusable UI components.
@RAMISAYAR
@RAMISAYAR
Image: http://coenraets.org/blog/2014/12/sample-mobile-application-with-react-and-cordova/
• React can be used on both
the client and server side.
• Uses a Virtual DOM to
selectively render subtrees of
components on state change.
@RAMISAYAR
• Adds this weird thing to your HTML called JSX.
• Let’s you write HTML-ish tags in JavaScript to simplify creating
components.
var HelloWorldComponent = React.createClass({
render: function(){
return ( <h1>Hello, world!</h1> );
}
});
And you can use ES6 classes instead of calling createClass()
@RAMISAYAR
• Added attributes are called props and can be used to render
dynamic data.
var HelloNameComponent = React.createClass({
render: function(){
return ( <h1>Hello, {this.props.name}!</h1> );
}
});
ReactDOM.render(<HelloNameComponent name="Rami"
/>, document.getElementById('app'));
@RAMISAYAR
• Every component has a state object and a props object.
• Functions & Objects:
• getInitialState – Return value is the initial value for state.
• setState – Sets the state and triggers UI updates.
• getDefaultProps – Sets fallback props values if props aren’t supplied.
@RAMISAYAR
• React events are attached as properties and can trigger
methods.
• Data flows unidirectionally via the state and props objects.
• React seams to rerender the whole app on every data change
but really it only ends up rerendering the parts that changed.
@RAMISAYAR
@RAMISAYAR
• React Native is like React but instead of using web components
that you build yourself… you use native components instead.
• React Native allows you to use the same React concepts but
instead build native iOS and Android applications.
• There is also support for the Universal Windows platform and
Tizen platform.
@RAMISAYAR
class HelloWorldApp extends React.Component {
render(){
return ( <h1>Hello, world!</h1> );
}
}
Becomes
class HelloWorldApp extends Component {
render() {
return ( <Text>Hello world!</Text> );
}
}
@RAMISAYAR
ReactDOM.render(<HelloNameComponent name="Rami"
/>, document.getElementById('app'));
Becomes
AppRegistry.registerComponent('HelloWorldApp',
() => HelloWorldApp);
@RAMISAYAR
@RAMISAYAR
• All components have a style prop that accepts a JavaScript
object.
• You can use StyleSheet.create() to create a more complex style
sheet object that you can reference in your components.
@RAMISAYAR
class LotsOfStyles extends Component {
render() { return (
<View>
<Text style={styles.red}>just red</Text>
<Text style={styles.bigblue}>just bigblue</Text>
</View> );
}
}
const styles = StyleSheet.create({
bigblue: { color: 'blue', fontWeight: 'bold', fontSize: 30, },
red: { color: 'red', }
});
@RAMISAYAR
Take a look at JavaScript style libraries: jss, cssx, jscss, react inline styles,
radium & more..
@RAMISAYAR
• Mobile viewports have fixed dimensions.
• React Native allows you to use the flexbox algorithm to layout
components, just like on the web*.
* A few exceptions. The defaults are different, with flexDirection
defaulting to column instead of row, and alignItems defaulting to
stretch instead of flex-start, and the flex parameter only supports a
single number.
@RAMISAYAR
• Displays vertically scrolling list of structured data.
• Only renders elements currently on screen.
• Extremely useful components that we will see in our demo.
@RAMISAYAR
react-native init AwesomeProject
cd AwesomeProject
react-native run-android
@RAMISAYAR
• React Native provides the Fetch API for your networking needs.
• Fetch will seem familiar if you have used XMLHttpRequest or
other networking APIs.
• The XMLHttpRequest API is built in to React Native.
• React Native also supports WebSockets for full-duplex
communication channels over a single TCP connection.
@RAMISAYAR
• ActivityIndicator
• ActivityIndicatorIOS
• DatePickerIOS
• DrawerLayoutAndroid
• Image
• ListView
• MapView
• Modal
• Navigator
• NavigatorIOS
• Picker
• PickerIOS
• ProgressBarAndroid
• ProgressViewIOS
• RefreshControl
• ScrollView
• SegmentedControlIOS
• Slider
• SliderIOS
• StatusBar
• SnapshotViewIOS
• Switch
• SwitchAndroid
• SwitchIOS
• TabBarIOS
• TabBarIOS.Item
• Text
• TextInput
• ToolbarAndroid
• TouchableHighlight
• TouchableNativeFeedback
• TouchableOpacity
• TouchableWithoutFeedback
• View
• ViewPagerAndroid
• WebView
@RAMISAYAR
@RAMISAYAR
• Nuclide is a package on top
of Atom to add support for
React Native, including
remote debugging.
• nuclide.io
@RAMISAYAR
Extension for Visual Studio
Code that allows you to debug
your code, quickly run react-
native commands from the
command palette and use
IntelliSense to browse objects,
functions and parameters for
React Native APIs.
github.com/Microsoft/vscode-
react-native
@RAMISAYAR
@RAMISAYAR
• No Need to Fork! Command-line Generator
• Apps, Components/Styles, Containers
(smart components), Screens
(opinionated containers), and more...
• ALL CODE works with iOS and Android
• Redux State Management
• Optional Redux Persistence (uses
AsyncStorage via redux-persist)
• Reactotron Ready
• Included Common Libs:
• react-native-vector-icons
• react-native-animatable
• react-native-i18n
• react-native-drawer
• apisauce
• reduxsauce
• react-native-maps
• rn-translate-template
• Included Developer Libs:
• reactotron
• AVA
• enzyme
• react-native-mock
• mockery
• nyc
@RAMISAYAR
• A cloud service that enables Cordova and React Native
developers to deploy mobile app updates directly to their
users’ devices. FREE.
• http://codepush.tools
@RAMISAYAR
@RAMISAYAR
@RAMISAYAR
• Introduction to React
• Introduction to React Native
• Building Apps with Flexbox
• Using the List View
• Builtin Components
• Demo Walkthrough
• Tools
@RAMISAYAR
tw: @ramisayar | gh: @sayar
@RAMISAYAR
©2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Office, Azure, System Center, Dynamics and other product names are or may be registered trademarks and/or trademarks in the
U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft
must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after
the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

More Related Content

PDF
Intro To React Native
PDF
React Native - Getting Started
PPT
PDF
Introduction to React Native
PPTX
Android jetpack compose | Declarative UI
PPTX
Reactjs
PDF
Intro to react native
PPTX
React native
Intro To React Native
React Native - Getting Started
Introduction to React Native
Android jetpack compose | Declarative UI
Reactjs
Intro to react native
React native

What's hot (20)

PDF
Jenkins Pipelines
PPTX
React Native
PPT
Java tutorial PPT
PDF
Pros & cons of svelte
PPTX
[Final] ReactJS presentation
PPTX
React JS: A Secret Preview
PPTX
Core java
PPTX
Introduction to JAVA
PPTX
Kotlin Jetpack Tutorial
PPTX
Mobile application development ppt
PPTX
Intro to React
PPTX
Kotlin on android
PPTX
React Native
PPTX
Flux architecture
PDF
Java Basic Oops Concept
PPTX
Jenkins CI/CD setup for iOS in Mac OSX
PDF
Spring framework core
PDF
Introduction of Xcode
PPTX
Dependency Inversion Principle
PPTX
ReactJS presentation.pptx
Jenkins Pipelines
React Native
Java tutorial PPT
Pros & cons of svelte
[Final] ReactJS presentation
React JS: A Secret Preview
Core java
Introduction to JAVA
Kotlin Jetpack Tutorial
Mobile application development ppt
Intro to React
Kotlin on android
React Native
Flux architecture
Java Basic Oops Concept
Jenkins CI/CD setup for iOS in Mac OSX
Spring framework core
Introduction of Xcode
Dependency Inversion Principle
ReactJS presentation.pptx
Ad

Viewers also liked (20)

PDF
React Native Introduction: Making Real iOS and Android Mobile App By JavaScript
PDF
React Native - Workshop
PDF
Introduction to React Native
PPTX
SONY BBS - React Native
PDF
Web a Quebec - JS Debugging
PDF
FITC - Exploring Art-Directed Responsive Images
PDF
An Intense Overview of the React Ecosystem
PDF
FITC - Here Be Dragons: Advanced JavaScript Debugging
PDF
What's New in ES6 for Web Devs
PDF
FITC - Bootstrap Unleashed
PDF
The State of WebSockets in Django
PDF
Introduzione a React Native - Alessandro Giannini
PDF
Introduction to React Native & Redux
PDF
React native - What, Why, How?
PPTX
Creating books app with react native
PDF
React Native: Developing an app similar to Uber in JavaScript
PDF
Putting the Native in React Native - React Native Boston
PDF
A tour of React Native
PDF
Devoxx France 2015 - Développement web en 2015
PDF
React Nativeはクロスプラットフォームモバイルアプリ開発の夢を見るか #DroidKaigi
React Native Introduction: Making Real iOS and Android Mobile App By JavaScript
React Native - Workshop
Introduction to React Native
SONY BBS - React Native
Web a Quebec - JS Debugging
FITC - Exploring Art-Directed Responsive Images
An Intense Overview of the React Ecosystem
FITC - Here Be Dragons: Advanced JavaScript Debugging
What's New in ES6 for Web Devs
FITC - Bootstrap Unleashed
The State of WebSockets in Django
Introduzione a React Native - Alessandro Giannini
Introduction to React Native & Redux
React native - What, Why, How?
Creating books app with react native
React Native: Developing an app similar to Uber in JavaScript
Putting the Native in React Native - React Native Boston
A tour of React Native
Devoxx France 2015 - Développement web en 2015
React Nativeはクロスプラットフォームモバイルアプリ開発の夢を見るか #DroidKaigi
Ad

Similar to Introduction to React Native (20)

PDF
An Overview of the React Ecosystem
PPTX
Reactjs notes.pptx for web development- tutorial and theory
PPTX
Full Stack_Reac web Development and Application
PDF
ReactJS vs AngularJS - Head to Head comparison
PPTX
NEXTjs.pptxfggfgfdgfgfdgfdgfdgfdgfdgfdgfg
PDF
Full Stack React Workshop [CSSC x GDSC]
PDF
Reconciling ReactJS as a View Layer Replacement (MidwestJS 2014)
PDF
MidwestJS 2014 Reconciling ReactJS as a View Layer Replacement
PPTX
GDSC NITS Presents Kickstart into ReactJS
PDF
React.js for Rails Developers
PDF
React on rails v4
PPTX
An evening with React Native
PPTX
React js programming concept
PPTX
How to create components in react js
PDF
React a11y-csun
PDF
Mastering JavaScript and DOM: A Gateway to Web Development
PDF
Ruby On Rails
PPT
Android Introduction
PDF
React Native
PPTX
From JSX to Deployment: Mastering the React Workflow for Scalable Front-End D...
An Overview of the React Ecosystem
Reactjs notes.pptx for web development- tutorial and theory
Full Stack_Reac web Development and Application
ReactJS vs AngularJS - Head to Head comparison
NEXTjs.pptxfggfgfdgfgfdgfdgfdgfdgfdgfdgfg
Full Stack React Workshop [CSSC x GDSC]
Reconciling ReactJS as a View Layer Replacement (MidwestJS 2014)
MidwestJS 2014 Reconciling ReactJS as a View Layer Replacement
GDSC NITS Presents Kickstart into ReactJS
React.js for Rails Developers
React on rails v4
An evening with React Native
React js programming concept
How to create components in react js
React a11y-csun
Mastering JavaScript and DOM: A Gateway to Web Development
Ruby On Rails
Android Introduction
React Native
From JSX to Deployment: Mastering the React Workflow for Scalable Front-End D...

Recently uploaded (20)

PPTX
Welding lecture in detail for understanding
PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
PPTX
web development for engineering and engineering
PDF
composite construction of structures.pdf
PPTX
Lesson 3_Tessellation.pptx finite Mathematics
PPTX
Sustainable Sites - Green Building Construction
PDF
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
PDF
Arduino robotics embedded978-1-4302-3184-4.pdf
PPTX
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
PPTX
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
PPTX
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
PPTX
CH1 Production IntroductoryConcepts.pptx
PPTX
Unit 5 BSP.pptxytrrftyyydfyujfttyczcgvcd
PPTX
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
PDF
Structs to JSON How Go Powers REST APIs.pdf
PPTX
Lecture Notes Electrical Wiring System Components
PPTX
Foundation to blockchain - A guide to Blockchain Tech
PPTX
Internet of Things (IOT) - A guide to understanding
PDF
Model Code of Practice - Construction Work - 21102022 .pdf
Welding lecture in detail for understanding
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
web development for engineering and engineering
composite construction of structures.pdf
Lesson 3_Tessellation.pptx finite Mathematics
Sustainable Sites - Green Building Construction
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
Arduino robotics embedded978-1-4302-3184-4.pdf
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
CH1 Production IntroductoryConcepts.pptx
Unit 5 BSP.pptxytrrftyyydfyujfttyczcgvcd
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
Structs to JSON How Go Powers REST APIs.pdf
Lecture Notes Electrical Wiring System Components
Foundation to blockchain - A guide to Blockchain Tech
Internet of Things (IOT) - A guide to understanding
Model Code of Practice - Construction Work - 21102022 .pdf

Introduction to React Native

  • 1. Rami Sayar - @ramisayar Senior Technical Evangelist Microsoft Canada @RAMISAYAR
  • 5. • Introduction to React • Introduction to React Native • Building Apps with Flexbox • Using the List View • Builtin Components • Demo Walkthrough • Tools @RAMISAYAR
  • 8. • React is a UI *library* developed at Facebook. • Lets you create interactive, stateful & reusable UI components. @RAMISAYAR
  • 10. • React can be used on both the client and server side. • Uses a Virtual DOM to selectively render subtrees of components on state change. @RAMISAYAR
  • 11. • Adds this weird thing to your HTML called JSX. • Let’s you write HTML-ish tags in JavaScript to simplify creating components. var HelloWorldComponent = React.createClass({ render: function(){ return ( <h1>Hello, world!</h1> ); } }); And you can use ES6 classes instead of calling createClass() @RAMISAYAR
  • 12. • Added attributes are called props and can be used to render dynamic data. var HelloNameComponent = React.createClass({ render: function(){ return ( <h1>Hello, {this.props.name}!</h1> ); } }); ReactDOM.render(<HelloNameComponent name="Rami" />, document.getElementById('app')); @RAMISAYAR
  • 13. • Every component has a state object and a props object. • Functions & Objects: • getInitialState – Return value is the initial value for state. • setState – Sets the state and triggers UI updates. • getDefaultProps – Sets fallback props values if props aren’t supplied. @RAMISAYAR
  • 14. • React events are attached as properties and can trigger methods. • Data flows unidirectionally via the state and props objects. • React seams to rerender the whole app on every data change but really it only ends up rerendering the parts that changed. @RAMISAYAR
  • 16. • React Native is like React but instead of using web components that you build yourself… you use native components instead. • React Native allows you to use the same React concepts but instead build native iOS and Android applications. • There is also support for the Universal Windows platform and Tizen platform. @RAMISAYAR
  • 17. class HelloWorldApp extends React.Component { render(){ return ( <h1>Hello, world!</h1> ); } } Becomes class HelloWorldApp extends Component { render() { return ( <Text>Hello world!</Text> ); } } @RAMISAYAR
  • 20. • All components have a style prop that accepts a JavaScript object. • You can use StyleSheet.create() to create a more complex style sheet object that you can reference in your components. @RAMISAYAR
  • 21. class LotsOfStyles extends Component { render() { return ( <View> <Text style={styles.red}>just red</Text> <Text style={styles.bigblue}>just bigblue</Text> </View> ); } } const styles = StyleSheet.create({ bigblue: { color: 'blue', fontWeight: 'bold', fontSize: 30, }, red: { color: 'red', } }); @RAMISAYAR
  • 22. Take a look at JavaScript style libraries: jss, cssx, jscss, react inline styles, radium & more.. @RAMISAYAR
  • 23. • Mobile viewports have fixed dimensions. • React Native allows you to use the flexbox algorithm to layout components, just like on the web*. * A few exceptions. The defaults are different, with flexDirection defaulting to column instead of row, and alignItems defaulting to stretch instead of flex-start, and the flex parameter only supports a single number. @RAMISAYAR
  • 24. • Displays vertically scrolling list of structured data. • Only renders elements currently on screen. • Extremely useful components that we will see in our demo. @RAMISAYAR
  • 25. react-native init AwesomeProject cd AwesomeProject react-native run-android @RAMISAYAR
  • 26. • React Native provides the Fetch API for your networking needs. • Fetch will seem familiar if you have used XMLHttpRequest or other networking APIs. • The XMLHttpRequest API is built in to React Native. • React Native also supports WebSockets for full-duplex communication channels over a single TCP connection. @RAMISAYAR
  • 27. • ActivityIndicator • ActivityIndicatorIOS • DatePickerIOS • DrawerLayoutAndroid • Image • ListView • MapView • Modal • Navigator • NavigatorIOS • Picker • PickerIOS • ProgressBarAndroid • ProgressViewIOS • RefreshControl • ScrollView • SegmentedControlIOS • Slider • SliderIOS • StatusBar • SnapshotViewIOS • Switch • SwitchAndroid • SwitchIOS • TabBarIOS • TabBarIOS.Item • Text • TextInput • ToolbarAndroid • TouchableHighlight • TouchableNativeFeedback • TouchableOpacity • TouchableWithoutFeedback • View • ViewPagerAndroid • WebView @RAMISAYAR
  • 29. • Nuclide is a package on top of Atom to add support for React Native, including remote debugging. • nuclide.io @RAMISAYAR
  • 30. Extension for Visual Studio Code that allows you to debug your code, quickly run react- native commands from the command palette and use IntelliSense to browse objects, functions and parameters for React Native APIs. github.com/Microsoft/vscode- react-native @RAMISAYAR
  • 32. • No Need to Fork! Command-line Generator • Apps, Components/Styles, Containers (smart components), Screens (opinionated containers), and more... • ALL CODE works with iOS and Android • Redux State Management • Optional Redux Persistence (uses AsyncStorage via redux-persist) • Reactotron Ready • Included Common Libs: • react-native-vector-icons • react-native-animatable • react-native-i18n • react-native-drawer • apisauce • reduxsauce • react-native-maps • rn-translate-template • Included Developer Libs: • reactotron • AVA • enzyme • react-native-mock • mockery • nyc @RAMISAYAR
  • 33. • A cloud service that enables Cordova and React Native developers to deploy mobile app updates directly to their users’ devices. FREE. • http://codepush.tools @RAMISAYAR
  • 36. • Introduction to React • Introduction to React Native • Building Apps with Flexbox • Using the List View • Builtin Components • Demo Walkthrough • Tools @RAMISAYAR
  • 37. tw: @ramisayar | gh: @sayar @RAMISAYAR
  • 38. ©2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Office, Azure, System Center, Dynamics and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.