react-hook-fetcher
react-hook-fetcher copied to clipboard
React simple API fetch hook
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>;
}