React Multiple Select Component
A very simple React component on top of a select element with multiple attribute.
It works just the same as a normal select element does, but the 'multiple' prop is always set to true, so it always renders a multiple select element.
The function passed as the 'onChange' prop will receive two parameters:
- The original event.
- An array of selected values (This is the only reason I've made this component).
For example:
;;; Component state = values: ; { console; console; this; } { return <MultipleSelect value=thisstatevalues onChange=thishandleChange > <option value="foo">foo</option> <option value="bar">bar</option> <option value="baz">baz</option> </MultipleSelect> ; } ReactDOM;