Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-fetch-hook

Package Overview
Dependencies
Maintainers
1
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-fetch-hook - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

2

package.json
{
"name": "react-fetch-hook",
"version": "1.0.2",
"version": "1.0.3",
"description": "React fetch hook",

@@ -5,0 +5,0 @@ "main": "./dist/index.js",

# react-fetch-hook
React hook, which allows you to conveniently work with *fetch*. Good Flow support.
## Installation

@@ -37,1 +39,20 @@

You can pass any *fetch* options:
```javascript
const { isLoading, data } = useFetch("https://swapi.co/api/people/1", {
method: "get",
headers: {
Accept: "application/json, application/xml, text/plain, text/html, *.*",
"Content-Type": "application/json; charset=utf-8"
}
});
```
You can pass *formatter* prop for using custom formatter function. Default is used *response => response.json()* formatter.
```javascript
const { isLoading, data } = useFetch("https://swapi.co/api/people/1", {
formatter: (response) => response.text()
});
```
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