Skip to content

Latest commit

 

History

18 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

axios-react-hooks

axios-react-hooks is a custom hooks library for consuming restful APIs using axios

How to Use

there is two hooks in this library:

  • useAxiosGet which can be used as below for GET requests:
const {data, loading, refetch} = useAxiosGet(
  {
    endpoint: 'your/api/endpoint/here',
    headers: {'header-name': 'header-value'}
  }
);
  • useAxiosPost which can be used as below for POST requests:
const [sendRequest, {data, loading}] = useAxiosPost(
  {
    endpoint: 'your/api/endpoint/here', 
    headers: {'header-name': 'header-value'}
  }
);
...
sendRequest(body);

author: allaith aldababseh

About

axios-react-hooks is a custom hooks library for consuming restful APIs using axios

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages