Skip to content

A wrapper component indicating when network connection has been lost

Notifications You must be signed in to change notification settings

react-z/react-native-no-connection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-native-no-connection

npm version

react-native-no-connection is a wrapper component indicating when network connection has been lost

Install

yarn add react-native-no-connection

Usage

import React from 'react'
import { ScrollView, Text } from 'react-native'
import NoConnection from 'react-native-no-connection'

export default class extends React.Component {
  getData () {
    console.log('fetching data now')
  }

  render() {
    return (
      <ScrollView>
        <NoConnection onConnectionRestored={this.getData.bind(this)}>
          <Text>Showing content now</Text>
        </NoConnection>
      </ScrollView>
    )
  }
}

Props

onConnectionRestored (required)

Function to run when connection has been restored

Styles

Uses styled-components 💅 for the base styling.

Development

yarn
npm run dev

Build

yarn
npm run build
npm login
npm version patch
git add -A
git push origin master
npm publish

License

MIT

About

A wrapper component indicating when network connection has been lost

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published