Skip to content

Installation

How to install betteruse in your project

Install betteruse using your preferred package manager:

npm install betteruse

Requirements

  • React 18 or later
  • React DOM 18 or later

TypeScript Support

betteruse is written in TypeScript and ships with complete type definitions. No additional @types packages are required.

import { useHold } from 'betteruse'
import type { UseHoldOptions, UseHoldReturn } from 'betteruse'

Usage

Import the hooks you need directly from betteruse:

import { useHold, useIdle, useMeasure, echo } from 'betteruse'

Each hook is tree-shakeable, so your bundle will only include the hooks you actually use.

All hooks are SSR-safe and will not cause hydration mismatches when used with Next.js or other SSR frameworks.

Next Steps

Now that you have betteruse installed, explore the individual hook documentation: