0.1.12 • Published 7 years ago

@unpourtous/react-native-stub-toast v0.1.12

Weekly downloads
4
License
MIT
Repository
github
Last release
7 years ago

react-native-stub-toast

JavaScript Style Guide

Introduction

A Toast component which can be called with static function, It does not need to add <Tosat /> every page.

Installation

npm install @unpourtous/react-native-stub-toast --save

Usage

First, add PopupStub as sibling node of you Root Node

export default class example extends Component {
  render () {
    return (
      <View style={styles.container}>
        {/* Your root node */} 
        <TouchableHighlight
          onPress={() => {
            // Step three: Use Toast with static function
            Toast.show('This is a Toast')
            Toast.show('This is a another Toast')
          }}>
          <Text>Show Toast</Text>
        </TouchableHighlight>
        
        {/* Step One: Add popup stub */} 
        <PopupStub ref={component => {
          this._popupStub = component
          // Step Two: Init toast with PopupStub ref
          Toast.init(this._popupStub)
        }} />
      </View>
    )
  }
}

License

This library is distributed under MIT Licence.

0.1.12

7 years ago

0.1.11

7 years ago

0.1.10

7 years ago

0.1.8

7 years ago

0.1.6

7 years ago

0.1.5

7 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago

0.1.7

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago