New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-native-fetch

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-fetch

Fetch API wrapped as a component for React Native

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
35
decreased by-43.55%
Maintainers
1
Weekly downloads
 
Created
Source

🌍 react-native-fetch

Fetch API wrapped as a component for React Native

Package version Downloads Standard Travis Build Standard Readme GitHub version Dependency CI License PRs Donate


Built with ❤︎ by Tiaan and contributors

Table of Contents

Table of Contents
  • Install
  • Usage
  • Contribute
  • License
  • Install

    $ npm install --save react-native-fetch
    # OR
    $ yarn add react-native-fetch
    

    Usage

    import Fetch from './fetch'
    
    export default class Home extends Component {
    
      _handleResponse = (res) => {
        console.log(res)
        res.text().then(console.log).catch(console.log)
      }
    
     _handleError = (error) => console.log(error)
    
     render () {
        return (
          <View style={styles.container}>
            <Fetch
              url="https://jsonplaceholder.typicode.com"
              onResponse={this._handleResponse}
              onError={this._handleError}
            />
          </View>
       )
     }
    }
    
    

    Properties

    • url (String) - The request url. Required.
    • onResponse (Function) - Fired when response is received.
    • onError (Function) - Fired when error occurs during request.
    • method (String) - HTTP request method. Default: 'GET'
    • body (String, body types) - HTTP request body.
    • headers (Object, Headers)- HTTP request headers to send. Default: {}
    • credentials (String) - Authentication credentials mode. Default: 'omit'

    Check out the fetch docs for more info.

    Contribute

    Contributions are welcome. Please open up an issue or create PR if you would like to help out.

    Note: If editing the README, please conform to the standard-readme specification.

    License

    Licensed under the MIT License.

    Keywords

    FAQs

    Package last updated on 07 Apr 2017

    Did you know?

    Socket

    Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

    Install

    Related posts

    SocketSocket SOC 2 Logo

    Product

    • Package Alerts
    • Integrations
    • Docs
    • Pricing
    • FAQ
    • Roadmap
    • Changelog

    Packages

    npm

    Stay in touch

    Get open source security insights delivered straight into your inbox.


    • Terms
    • Privacy
    • Security

    Made with ⚡️ by Socket Inc