react-hookz / web

React hooks done right, for browser and SSR.
https://react-hookz.github.io/web/
MIT License
1.93k stars 94 forks source link

fix(add-new-hook): use es module import syntax in add-new-hook script #1566

Open czinck opened 1 week ago

czinck commented 1 week ago

What is the current behavior, and the steps to reproduce the issue?

yarn new-hook useNewHook fails with an error on the require() lines.

What is the expected behavior?

It creates a new directory and files.

How does this PR fix the problem?

It uses the ES module import syntax, instead of cjs. It looks like this file was missed in https://github.com/react-hookz/web/pull/1472, which converted everything else to use ES module syntax.

Checklist