https://github.com/novajslabs/hook-crafter
Build a React hook library faster
https://github.com/novajslabs/hook-crafter
react-custom-hook react-custom-hooks react-hooks typescript vite
Last synced: 9 days ago
JSON representation
Build a React hook library faster
- Host: GitHub
- URL: https://github.com/novajslabs/hook-crafter
- Owner: dlcastillop
- License: mit
- Created: 2023-09-08T20:05:39.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-05-27T13:36:26.000Z (11 months ago)
- Last Synced: 2024-05-27T13:55:14.009Z (11 months ago)
- Topics: react-custom-hook, react-custom-hooks, react-hooks, typescript, vite
- Language: TypeScript
- Homepage:
- Size: 159 KB
- Stars: 12
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
#
Hook Crafter
A Vite and TypeScript template for building your React hook library.
## Getting started
### Create the project
To create a Hook Crafter project, run:
```sh
npm create hook-crafter
``````sh
yarn create hook-crafter
``````sh
pnpm create hook-crafter
```Then follow the prompt.
### Install the dependencies
Install the dependencies with npm, yarn, or pnpm.
```sh
npm install
``````sh
yarn
``````sh
pnpm install
```### Create your hooks
Create all your hooks inside the `src/hooks` directory.
```ts
import { useState } from "react";export const useCountUp = (increase: number) => {
const [count, setCount] = useState(0);const increment = () => setCount(count + increase);
return { count, increment };
};
```And export them in the `index.ts` file.
```ts
export * from "./useCountUp";
```## Questions
For questions and support please [open a discussion](https://github.com/novajslabs/hook-crafter/discussions).
## Support
You can support this project in several ways:
### Star us
Star [this repo](https://github.com/novajslabs/hook-crafter).
### Share
- [LinkedIn](http://www.linkedin.com/shareArticle?mini=true&url=https://hookcrafter.dev/)
- [WhatsApp](https://api.whatsapp.com/send?text=https://hookcrafter.dev/)
- [Facebook](https://www.facebook.com/sharer/sharer.php?u=https://hookcrafter.dev/)
- [X](https://twitter.com/intent/tweet?url=https://hookcrafter.dev/)
- [Reddit](https://www.reddit.com/submit?url=https://hookcrafter.dev/)## License
[MIT](https://github.com/novajslabs/hook-crafter/blob/main/LICENSE)