1.0.0 • Published 5 years ago
@tombeck/use-star-wars-quote v1.0.0
@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.
1.0.0
5 years ago