@hookeasy/use-axios

1.0.0 • Public • Published

@hookeasy/use-use-axios

React Hook to update your useAxios event

install

npm i @hookeasy/use-useAxios

or

yarn add @hookeasy/use-useAxios

example

import React from "react";
import ReactDOM from "react-dom";
import useAxios from "@hookeasy/use-axios";

const App = () => {
  const { loading, data, error, refetch } = useAxios({
    url: "https://yts.lt/api/v2/list_movies.json"
  });

  return (
    <div className="App">
      <h1>{data && data.status}</h1>
      <h2>{loading & "Loading"}</h2>
      <button onClick={refetch}>Refetch</button>
    </div>
  );
};

const rootElement = document.getElementById("root");
ReactDOM.render(<App />, rootElement);

Package Sidebar

Install

npm i @hookeasy/use-axios

Weekly Downloads

3

Version

1.0.0

License

MIT

Unpacked Size

2.78 kB

Total Files

5

Last publish

Collaborators

  • baram