Dialogs - lazaronixon/react-native-turbolinks GitHub Wiki

This Wiki show you how to use React Native Turbolinks integrated with React Native Form Sheet.

Installation

$ yarn add react-native-form-sheet
$ cd ios && pod install && cd .. # CocoaPods on iOS needs this extra step

Basic Usage

import React, { Component } from 'react'
import Turbolinks from 'react-native-turbolinks'
import FormSheet from 'react-native-form-sheet';

export default class App extends Component {

  componentDidMount() {
    Turbolinks.addEventListener('turbolinksVisit', this.handleVisit)
    Turbolinks.addEventListener('turbolinksError', this.handleError)
    Turbolinks.addEventListener('turbolinksActionPress', this.handleActionPress)
    Turbolinks.startSingleScreenApp({url: 'http://MYIP:9292', actions: [{id: 0, title: 'Page One'}] })
  }

  handleVisit = (data) => {
    Turbolinks.visit({url: data.url, action: data.action, visibleDropDown: true, title: 'Show Dialog'})
  }

  handleError = (data) => {
    alert(data.description)
  }

  handleActionPress = (data) => {
    FormSheet.present({component: 'NumbersView', width: 280, height: 380})
  }

  render() {
    return null
  }
}