# react-use-fuse

> A tiny wrapper for the Fuse.js library fuzzy-search using React Hooks.

Latest version **0.5.2** (published 2019-06-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-use-fuse
pnpm add react-use-fuse
yarn add react-use-fuse
bun add react-use-fuse
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.5.2 |
| Published | 2019-06-27 |
| First published | 2019-06-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 12.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 31 |
| Author | Martin Lindgren |
| Maintainers | g1zmo |

## Links

- npm: https://www.npmjs.com/package/react-use-fuse
- Repository: https://github.com/MartinL83/react-use-fuse
- Homepage: https://github.com/MartinL83/react-use-fuse#readme
- Issues: https://github.com/MartinL83/react-use-fuse/issues
- npm.io page: https://npm.io/package/react-use-fuse

## Recent versions

- 0.5.2 (latest) — 2019-06-27
- 0.5.1 — 2019-06-26
- 0.5.0 — 2019-06-26

## README

# react-use-fuse
A tiny wrapper for the fuzzy-search library [Fuse.js](https://fusejs.io) using React Hooks.

## Example usage
```sh

const customers = [
    {id: 1, name: 'Customer A', email: 'aa@aa.com'},
    {id: 2, name: 'Customer B' email: 'mm@mm.com'}
]

function MyComponent({customers}){

    // This is Fuse specific options. Read more at
    // https://fusejs.io/#examples
    const options = {
        keys: ["name", "email"]
    }

    // Setup the Hook.
    const { result, search, term, reset } = useFuse({
        data: customers,
        options
    });

    return (
        <div>
            <input
                onChange={e => search(e.target.value)}
                value={term}
                placeholder="Search for a customer..."
            />

            {result.map(customer => (
                <div>
                    {customer.name} - {customer.email}
                </div>
            ))}
        </div>
    )
}

<MyComponent customers={customers} />
```

---
_Source: https://npm.io/package/react-use-fuse · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
