Skip to content

useDebounce

Debounces a value.

Usage

import { useState } from "react";
import { useDebounce } from "@/hooks/effects/use-debounce";
const Component = () => {
const [value, setValue] = useState("");
const debouncedValue = useDebounce(value, 500);
return (
<input value={value} onChange={(event) => setValue(event.target.value)} />
);
};

Installation

Terminal window
npx atmx add hook use-debounce