# useSearch search through an array with the provided key. Returns an `onChange` function and `value` to bind to a input field. Returns `filtered` with the filtered data. ## Example ```tsx import { useSearch } from "@casperiv/useful/hooks/useSearch"; interface MyData { name: string; age: string; } const Component = () => { const { onChange, search, filtered } = useSearch("name", myDataArr); return (
{filtered.map((item) => (

{item.name}

))}
); }; ```