๐Ÿ’ง plop generator react hook

September 21, 2021 ยท View on GitHub

version downloads size github actions coverage typescript contributing contributors discord

A plop generator for react hooks.

๐Ÿ“ฆ Installation

This package is hosted on npm.

npm install --save-dev @bradgarropy/plop-generator-react-hook

๐Ÿฅ‘ Usage

First, be sure you have plop installed. Then, add the following line to your plopfile.js.

plop.load("@bradgarropy/plop-generator-react-hook")

Now you'll have access to the hook generator as shown below.

plop hook

The hook generator scaffolds a hook, including tests, and adds it to the index.ts file for easy importing. The resulting directory looks like this for a hook named useHook.

src
โ””โ”€โ”€ hooks
   โ”œโ”€โ”€ index.ts
   โ””โ”€โ”€ useHook
      โ”œโ”€โ”€ index.ts
      โ”œโ”€โ”€ useHook.tsx
      โ””โ”€โ”€ useHook.test.tsx

โ” Questions

๐Ÿ› report bugs by filing issues
๐Ÿ“ข provide feedback with issues or on twitter
๐Ÿ™‹๐Ÿผโ€โ™‚๏ธ use my ama or twitter to ask any other questions

โœจ contributors


Brad Garropy

๐Ÿ’ป ๐Ÿ“– โš ๏ธ ๐Ÿš‡