1.0.2 • Published 5 years ago

@mtliendo/react-use-dad-joke v1.0.2

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

@mtliendo/react-use-dad-jokes

A custom react hook for getting the best dad jokes!

NPM JavaScript Style Guide

Install

npm install --save @mtliendo/react-use-dad-joke

Usage

import React, { Component } from 'react'

import { useDadJoke } from '@mtliendo/react-use-dad-joke'

const App = () => {
  const { isLoading, error, dadJoke } = useDadJoke();

  if (isLoading) return "Loading...";

  if (error) return "uh oh...something went wrong";

  return <main>{dadJoke.joke}</main>;
};

License

MIT © mtliendo


This hook is created using create-react-hook.

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago