{}Snippt
ExploreTags
New

Tags

Browse snippets grouped by topic.

react3utils3hooks2typescript2bash1database1go1http1linux1python1sql1

#hooks

Debounced search input

@maya_dev·14h ago

TSX
function SearchBox({ onSearch }: { onSearch: (q: string) => void }) {
    const [value, setValue] = useState('')
    const debounced = useDebounce(value, 250)
20301#hooks #react

useDebounce hook

@maya_dev·5d ago

TypeScript
import { useState, useEffect } from 'react'

export function useDebounce<T>(value: T, delay = 300): T {
    const [debounced, setDebounced] = useState(value)
34221#hooks #react #typescript
{}SnipptShare code, instantly.
ExploreTagsNew snippetSearch