An open API service indexing awesome lists of open source software.

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

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)