@tombeck/use-star-wars-quote
v1.0.0
Published
a custom React hook that provides a random Star Wars quote
Downloads
4
Readme
@tombeck/use-star-wars-quote
a custom React hook that provides a random Star Wars quote
Install
npm install --save @tombeck/use-star-wars-quote
Usage
import React from 'react'
import { useStarWarsQuote } from '@tombeck/use-star-wars-quote'
const App = () => {
const { quote, loading } = useStarWarsQuote()
if (loading) {
return (<p>Loading</p>)
}
if (quote) {
return (
<div>
{quote}
</div>
)
}
return null
}
export default App
License
MIT © tbeck
This hook is created using create-react-hook.