NivedhithaV / shareable-custom-hooks-react

All the code for my newest egghead course: Writing Shareable Custom Hooks in React

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool


Writing Shareable Custom React Hooks


Take Workshop

Ask a Question · Report Bug

Table of Contents

About The Workshop

Hooks are awesome because they're "first-class" utility functions provided by React to let you hook into state and other features while writing components. The cool thing about Hooks is that you can build on top of them to make your own. It’s like writing a function on top of lodash. You can gather something that might be reusable, and then package it up into a custom hook. That is the beauty of writing a shareable custom Hook in React.

Workshop Goals

After completing this workshop, you will understand how to write custom Hooks in React, and publish them as npm packages for the open source community.

Workshop Outcomes

By taking this workshop, you will learn how to:

  1. Understand what a “first-class” Hook is and isn’t
  2. Understand what a custom Hook is
  3. Write a custom Hook in an existing application
  4. Extract the Hook into a module
  5. Test the Hook locally
  6. Publish the Hook as an npm package

Prerequisites

Although this workshop is not targeted at React experts you'll need the following:

  • moderate React experience
  • some familiarity with Hooks
  • an npm account

Pre-Workshop Instructions

Before you join us for the workshop, please make sure to the following:

  1. Download Zoom
  2. Clone this repo so you have it locally
  3. Create an npm account (needed to publish your package)
  4. Install create-react-hook globally
  • npm i -g create-react-hook
  • yarn add global create-react-hook
  • or you can run it during the workshop using `npx create-react-hook

Resources

If you run into road blocks at anytime in the workshop or want additional resources, here's a list of things to check out:

About

All the code for my newest egghead course: Writing Shareable Custom Hooks in React


Languages

Language:JavaScript 78.0%Language:HTML 22.0%