react-hook-fetcher

React simple API fetch hook

Usage no npm install needed!

<script type="module">
  import reactHookFetcher from 'https://cdn.skypack.dev/react-hook-fetcher';
</script>

README

React Hook Fetcher

React simple fetch API hook

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>;
}