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