@alobato/use-fetch

React hook for fetch

Usage no npm install needed!

<script type="module">
  import alobatoUseFetch from 'https://cdn.skypack.dev/@alobato/use-fetch';
</script>

README

useFetch

React hook for fetching json data

Note: This is using the new React Hooks API

You'll need to install react, react-dom, etc at ^16.8.0 or above

Install

yarn add @alobato/usefetch

Usage

import useFetch from '@alobato/usefetch'

const { data, error, loading } = useFetch('https://api.github.com/repos/alobato/usefetch')