1.0.0 • Published 5 years ago

@tombeck/use-star-wars-quote v1.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

@tombeck/use-star-wars-quote

a custom React hook that provides a random Star Wars quote

NPM JavaScript Style Guide

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.