Skip to content

TanStack Start

Install and configure reactuse for TanStack Start.

Create project

Run the following command to create a new TanStack Start project:

bash
npm create @tanstack/start@latest my-app -- --tailwind

Edit tsconfig.json file

Ensure your tsconfig.json includes path aliases:

json
{
  "compilerOptions": {
    "baseUrl": ".",
    "paths": {
      "@/*": ["./src/*"]
    }
  }
}

Run the CLI

Run the useverse init command to setup your project:

bash
npx useverse@latest init

This will create a configuration file reactuse.json in your project.

Add hooks

You can now start adding hooks to your project.

bash
npx useverse@latest add useBoolean

The command above will add the useBoolean hook to your project. You can then import it like this:

tsx
import { useBoolean } from '@/shared/hooks';

const Home = () => {
  const [on, toggle] = useBoolean();

  return (
    <div>
      <button type='button' onClick={() => toggle()}>
        Click me
      </button>
      <p>{on.toString()}</p>
    </div>
  );
};

export default Home;

Released under the MIT License.