2.0.0 • Published 4 years ago
@manuelm2/use-star-wars-quote v2.0.0
@manuelm2/use-star-wars-quote
a custom react hook that provides a random star wars quote
Install
npm install --save @manuelm2/use-star-wars-quote
Usage
import React from 'react'
import { useStarWarsQuote } from '@manuelm2/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 © manueljosemt
This hook is created using create-react-hook.