Skip to content

An react hook that will get you hooked on react! 😅🤦‍♂️

Notifications You must be signed in to change notification settings

mtliendo/react-use-dad-joke

Repository files navigation

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

About

An react hook that will get you hooked on react! 😅🤦‍♂️

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published