beekai-oss / react-hook-fetcher

React simple API fetch hook

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

React Hook Fetcher

Simple React hook for the fetch API.

Intall

$ npm install react-hook-fetcher

Example

function App() {
  const {
    fetcher,
    result,
    isLoading,
  } = useFetcher();

  useEffect(() => {
   fetcher('http://http://google.com.au/')
  }, []);

  return <div>{isLoading ? 'Loading...' : result}</div>;
}

By the makers of BEEKAI

We also make BEEKAI. Build the next-generation forms with modern technology and best in class user experience and accessibility.

About

React simple API fetch hook


Languages

Language:JavaScript 100.0%