@jsjoeio/use-star-wars-quote
v1.0.0
Published
a custom React hook that provides a random Star Wars quote
Downloads
1
Readme
@jsjoeio/use-star-wars-quote
a custom React hook that provides a random Star Wars quote
Install
npm install --save @jsjoeio/use-star-wars-quote
Usage
import React from 'react'
import { useStarWarsQuote } from '@jsjoeio/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 © jsjoeio
This hook is created using create-react-hook.