1.0.0 • Published 4 years ago
use-cat-api v1.0.0
use-cat-api
React hook to fetch data from the cat-api
Install
npm install --save use-cat-api
Usage
import React from 'react'
import { useCatApi } from 'use-cat-api'
const App = () => {
const {loading, data} = useCatApi()
if (loading) {
return (
<div>
{loading}
</div>
)
} else {
return (
<div>
{JSON.stringify(data)}
</div>
)
}
}
export default App
License
MIT © berzerk-interactive
This hook is created using create-react-hook.
1.0.0
4 years ago