react-hooks-axios

npm install react-hooks-axios

Usage no npm install needed!

<script type="module">
  import reactHooksAxios from 'https://cdn.skypack.dev/react-hooks-axios';
</script>

README

React Hook Axios

Installation

npm install react-hooks-axios

Usage

import React from 'react';

import useAxios from 'react-hooks-axios';

const AnyComponent = props => {
  const [{ data, isLoading, isError }, doFetch] = useAxios(
    'http://hn.algolia.com/api/v1/search?query=redux',
    null,
  );

  ...
};

Contribute

  • git clone git@github.com:peng-yin/react-hooks-axios.git
  • cd react-hooks-axios
  • npm install