File tree Expand file tree Collapse file tree 1 file changed +24
-8
lines changed Expand file tree Collapse file tree 1 file changed +24
-8
lines changed Original file line number Diff line number Diff line change @@ -43,17 +43,18 @@ ReactDOM.render(<App />, document.getElementById('root'));
4343## Demo:
4444
4545[ Demo] ( https://codesandbox.io/s/github/amitdabade/react-use-fetch-demo )
46+ [ Storybook] ( https://amitdabade.github.io/react-use-fetch )
4647
47- ## Options :
48+ ## Configurations :
4849
49- ### GET
50+ ** GET**
5051```
5152useFetch({
5253 url: "https://jsonplaceholder.typicode.com/todos/1"
53- })
54+ });
5455```
5556
56- ### POST
57+ ** POST**
5758```
5859useFetch({
5960 url: "https://jsonplaceholder.typicode.com/posts",
@@ -63,19 +64,34 @@ useFetch({
6364 "id": 1,
6465 "title": "sunt aut facere",
6566 "body": "quia et suscipit"
66- })
67- })
67+ })
68+ });
6869```
6970
70- ### HEADERS
71+ ** HEADERS**
7172```
7273useFetch({
7374 url: "https://jsonplaceholder.typicode.com/posts",
7475 headers: {
7576 'Accept': 'application/json',
7677 'Content-Type': 'application/json'
7778 }
78- })
79+ });
80+ ```
81+
82+ ** Default Config**
83+ ```
84+ const config = {
85+ delay: 0,
86+ retry: 0,
87+ refetchInterval: 0,
88+ refetch: Infinity,
89+ responseType: "text",
90+ };
91+
92+ useFetch({
93+ url: "https://jsonplaceholder.typicode.com/posts"
94+ }, config);
7995```
8096
8197## License:
You can’t perform that action at this time.
0 commit comments