search input for react
install
npm install --save-dev search-input-react close-canvas-react style-loader css-loader
webpack.config.js
// add loader
{
test: /\.css$/,
loader: "style-loader!css-loader"
}
import
import SearchInput from 'search-input-react'
use
<SeacrchInput placeholder='placeholder' defaultValue='defaultValue' regex=thissearchInputRegex searchClick=thissearchInputClick inputChange=thissearchInputChange setClearValue= thissearchInputClearValue = handle/>
searchClick: click glass or hit enter,get the value
{ console}
inputChange: link to searchInput's onChange
{ console}
placeholder: placeholder, optional
defaultValue: defaultValue, optional
regex: the regex with your logic, optional
setClearValue: clear value, optional