Skip to content

Latest commit

 

History

History
37 lines (22 loc) · 903 Bytes

README.md

File metadata and controls

37 lines (22 loc) · 903 Bytes

@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.