UNPKG

741 BMarkdownView Raw
1## ReactSelect
2
3A searchable select box, similar to select2.
4
5What is different about this plugin? It doesn't build an underlying select item, but acts like it.
6Behaviour and select action is to be passed as a prop, allowing full compatibility with redux.
7
8[demo](https://adamgajzlerowicz.github.io/ReactSelect/)
9
10install:
11```
12npm install --save select-react-redux
13```
14
15usage:
16```
17import React from 'react';
18import {render} from 'react-dom';
19import Select from 'select-react-redux';
20
21const items = {
22 'item1': 'Mercedes Benz C40',
23 'item2': 'Mazda 6',
24};
25
26const onChange = (val) => {
27 console.log(val);
28};
29
30render((
31 <div>
32 <Select items={items} onChange={onChange}/>
33 </div>
34), document.getElementById('app'));
35```
36