A simple value wrapper for react-select
npm install react-select-simple-valueA simple value wrapper for react-select.
``bash`
yarn add react-select-simple-value
`jsx
import ReactSelect from 'react-select';
import SimpleValue from 'react-select-simple-value';
export const MySelect = ({ options, value, ...props }) => (
{simpleProps =>
);
/ elsewhere in your application /
class extends React.Component {
render() {
return (
{ value: 'blue', label: 'Blue' },
{ value: 'red', label: 'Red' },
{ value: 'yellow', label: 'Yellow' },
]}
value="blue"
/>
);
}
}
`
The following props are accepted, consumed, and passed on to the children function. Only defaultValue and value` are augmented.
- defaultValue
- getOptionValue
- isMulti
- options
- value