1.0.3 • Published 3 years ago

react-search-box-component v1.0.3

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

react-search-box-component

Description

  • A package for fetching the input value with delay
  • Reduces render
  • Inbuilt props provides the value
  • Curretly works with JS Project

Install via npm

npm i react-search-box-component

Install via yarn

yarn add react-search-box-component

Docs

Import Searchbox

import {Searchbox} from 'react-search-box-component'

Usage

 <Searchbox delay={500} setVal={setDelay} placeholder="Search ..." />

Props

  • delay: for retruning the value in (ms) duration
  • setVal: holds the state value

Example

import { useState } from "react";
import "./App.css";
import { Searchbox } from "react-search-box-component";

function App() {
  const [view, setView] = useState("");
  const [delay, setDelay] = useState(0);
  return (
    <div className="App">
      <Searchbox delay={500} setVal={setDelay} placeholder="Search ..." />
      <br />
      <span>{view}</span>
    </div>
  );
}

export default App;

Maintainers

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago