https://github.com/arn4v/use-fuse2
https://github.com/arn4v/use-fuse2
Last synced: 6 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/arn4v/use-fuse2
- Owner: arn4v
- Created: 2021-08-14T10:05:03.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-08-14T10:15:46.000Z (almost 5 years ago)
- Last Synced: 2025-01-30T09:47:29.320Z (over 1 year ago)
- Language: TypeScript
- Size: 117 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# useFuse2
React hook for fuzzy searching using Fuse.js
## Usage
```tsx
import useFuse from "use-fuse2";
import { useState } from "react";
type BlogPost = {
title: string;
content: string;
};
export default function PostList({ data }: { data: BlogPost[] }) {
const [query, setQuery] = useState("");
const { result } = useFuse({ data, query });
return (
<>
setQuery(e.target.value)} />
- {title}
{result.map(({ title }) => (
))}
>
);
}
```