@rahsheen/use-chuck-norris
v1.0.1
Published
Hook to use Chuck Norris API from api.chucknorris.io
Downloads
2
Readme
use-chuck-norris
Hook to use Chuck Norris API
Install
npm install --save use-chuck-norris
Usage
import * as React from 'react'
import useChuckNorris from 'use-chuck-norris'
function Example() {
const {
setCategory,
joke,
newJoke,
categories,
tweetUrl,
jokeId
} = useChuckNorris();
render () {
return (
<div>
<p>{joke}</p>
<button onClick={newJoke}>
New Joke
</button>
</div>
)
}
}
License
MIT © rahsheen