Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Basics React Native

Basics React Native

Memahami dasar-dasar React Native, sehingga kita tidak kebingungan saat sudah memasuki dunia React Native

Nila Wilda Al Aluf

October 18, 2017
Tweet

More Decks by Nila Wilda Al Aluf

Other Decks in Education

Transcript

  1. Co-Lead DevC Surabaya, Facilitator in Android Kejar, art, design, photograph,

    writing and I love Sintax Nila Wilda Al Aluf Front End Engineer at pinjam.co.id Github @nilawildaalaluf Contact [email protected] @nilawilda
  2. ! It’s Framework, While ReactJs is Library ! Same codeStyle

    with ReactJs ! Truly Native Mobile Apps For IOS and Android ! Faster the Hybrid Tech Why React Native?
  3. Solved Promblem? ! Easy Build Apps IOS and Android !

    Cross Platform ! Learn Once, Write Everywhere
  4. The five key concepts are: . Components . JSX .

    Props & State . The Component API . Component Types React Native Concepts
  5. JSX

  6. State import React, { Component } from 'react' import {

    TextInput, Text, View } from 'react-native' export default class State extends Component { constructor(){ super() this.state = { nama : ‘Jeny' } } render() { return ( <View> <Text>Nama Saya {this.state.nama} </Text> </View> ) } }
  7. Props import React, { Component } from 'react'; import {

    AppRegistry, Text, View } from 'react- native'; class Greeting extends Component { render() { return ( <Text>Hello {this.props.name}!</Text> ); } } export default class LotsOfGreetings extends Component { render() { return ( <View style={{alignItems: 'center'}}> <Greeting name='Rexxar' /> <Greeting name='Jaina' /> <Greeting name='Valeera' /> </View> ); } } AppRegistry.registerComponent('AwesomeProject', () => LotsOfGreetings);
  8. • npm install -g react-native-cli • react-native init ReactNativeApi •

    cd ReactNativeApi • react-native run-ios/react-native run-android Install React Native
  9. 1 Learn Once, Write Everywhere Cost Efficiency 3 2 No

    More Civil War, Choose base on your needs Conclusion