Icons - lazaronixon/react-native-turbolinks GitHub Wiki
This Wiki show you how to use React Native Turbolinks integrated with React Native Vector Icons.
Installation
https://github.com/oblador/react-native-vector-icons#installation
Basic Usage
import React, { Component } from 'react'
import Turbolinks from 'react-native-turbolinks'
import Icon from 'react-native-vector-icons/Ionicons'
export default class App extends Component {
componentDidMount = async () => {
await this.initializeIcons()
Turbolinks.addEventListener('turbolinksVisit', this.handleVisit)
Turbolinks.addEventListener('turbolinksError', this.handleError)
Turbolinks.startSingleScreenApp({url: 'http://MYIP:9292', leftButtonIcon: this.cogIcon})
}
handleVisit = (data) => {
Turbolinks.visit({url: data.url, action: data.action})
}
handleError = (data) => {
alert(data.description)
}
initializeIcons = async () => {
this.cogIcon = await Icon.getImageSource('ios-cog', 20, 'blue')
this.homeIcon = await Icon.getImageSource('ios-home', 20, 'blue')
this.infoIcon = await Icon.getImageSource('ios-information-circle', 20, 'blue')
this.refreshIcon = await Icon.getImageSource('ios-refresh', 20, 'blue')
this.shareIcon = await Icon.getImageSource('ios-share', 20, 'blue')
}
render() {
return null
}
}