A Vite and TypeScript template for building your React hook library.
To create a Hook Crafter project, run:
npx create-hook-crafter
pnpm dlx create-hook-crafter
Then follow the prompt.
Install the dependencies with npm, yarn, or pnpm.
npm install
yarn
pnpm install
Create all your hooks inside the src/hooks
directory.
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.
export * from "./useCountUp";
For questions and support please open a discussion.
You can support this project in several ways:
Star this repo.