New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-search-fuse

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-search-fuse

Fuse.js, as a React component

0.0.2
latest
Source
npm
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

react-search-fuse

A Fuse.js powered client side fuzzy search react component.

disclaimer: This is still a bit of a work in progress. It has some limitations, so use at your discretion

Build
Status

Installation and Usage

npm install react-search-fuse

Import ReactSearchFuse where you would like to use it.

import ReactSearchFuse from 'react-search-fuse'

Supply some documents, specify the options, and a filter to search by. Then just supply a children render function which will receive results.

<ReactSearchFuse
  options={{keys: ['name', 'character']}}
  documents=[
    {id: 1, name: 'Logan', character:'Wolverine'},
    {id: 2, name: 'Anna Marie', character: 'Rogue'}
  ]>
  {results => result.map(result => (
    <div key={result.id}>
      <h1>{result.name}</h1> - {result.character}
    </div>
  ))}
</ReactSearchFuse>

Todo

This isn't quite finished. Some of the planned changes:

  • the fuse index is rebuild on every rerender, it could probably be more performant

Keywords

react

FAQs

Package last updated on 23 Oct 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts