React Native from Rubyist's Perspective

Alexey Vasiliev, Railsware

React Native from Rubyist's Perspective

Brought to you by Alexey Vasiliev, Railsware

Alexey Vasiliev

Before start

Most popular topic by votes:
Does Rails 5 ready for production?

Yes!!!

Back to the topic

Mobile development solutions (iOS and Android)

React Native

  • React!!!
  • It is not hybrid/html5 app
  • Use native code when you need to
  • Fast view changes - no need to recompile
ReactNativeGettingStarted
ReactNativeSchema
ReactNativeCodeExec

Example

import React from 'react';
import {Text, View} from 'react-native';

class RubyMeditationMobile extends React.Component {
  render() {
    return (
      <View>
        <Text>Hello Rubymeditation!</Text>
      </View>
    );
  }
}

Example

import {AppRegistry} from 'react-native';

AppRegistry.registerComponent(
  'RubyMeditationMobile',
  () => RubyMeditationMobile
);

Example

$ react-native start // start dev server

$ react-native run-ios // run app in ios emulator

$ react-native run-android // run app in android emulator
ReactNativeCodeDemo1

Style

import {StyleSheet} from 'react-native';
const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: '#F5FCFF',
  },
  hello: {
    fontSize: 20,
    textAlign: 'center',
    margin: 10,
  },
});

Style

export default class RubyMeditationMobile extends React.Component {
  render() {
    return (
      <View style={styles.container}>
        <Text style={styles.hello}>Hello RubyMeditation!</Text>
      </View>
    );
  }
}
ReactNativeCodeDemo2

React Native components

React Native API

Networking

fetch('https://mywebsite.com/endpoint/', {
  method: 'POST',
  headers: {
    'Accept': 'application/json',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    firstParam: 'yourValue',
    secondParam: 'yourOtherValue',
  })
})

React Native Plugins

React Native Benefits

React Native Disadvantages

React Native Disadvantages

<Thank You!> Any Questions?

Contact information

QuestionsSlide