What is React Native
core components
Text Image View TextInput ListView
virtual DOM
Flexbox
- provides a fixed layout on different screen sizes
FlatList
component that displays the content in similarly structured data as a scrollable list
geolocation
use the Location Services :
props
// Parent
export default class ScreenOne extends React.Component {
render () {
return () } }
// Child component
export default class Heading extends React.Component {
render () {
return ( {this.props.message} )
}
}
Heading.propTypes = {
message: PropTypes.string
}
Heading.defaultProps = {
message: 'Heading One'
}state
class Form extends React.Component {
constructor (props) {
super(props)
this.state = {
input: ''
}
}handleChangeInput = (text) => {
this.setState({ input: text })
}
render () {
const { input } = this.state
return ( ) } }
StyleSheet.create
- only created once
Steps to create and start a React Native app
XHR Module
used for implementation of XMLHttpRequest to post data on the server
function used to pass values between screens
this.props.navigation.navigate(‘RouteName, { /* params go here */ })
JavaScriptCore
- helps developers create own browser
WebView
Gesture Responder System
manages lifecycle of gestures in the app
native events supported by React Native
Clipboard Events Composition Events Keyboard Events Focus Events Form Events Mouse Events Pointer Events Selection Events Touch Events UI Events Wheel Events Media Events Image Events Animation Events Transition Events
React Native Platform module
used to detect the platform of the device
timer related functions
setTimeout, clearTimeout
setInterval, clearInterval
setImmediate, clearImmediate
requestAnimationFrame, cancelAnimationFrame