An open API service indexing awesome lists of open source software.

https://github.com/arn4v/use-fuse2


https://github.com/arn4v/use-fuse2

Last synced: 6 months ago
JSON representation

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)} />


    {result.map(({ title }) => (
  • {title}

  • ))}

>
);
}
```