React-select: Multi select es6 example

Created on 25 Jan 2017  路  2Comments  路  Source: JedWatson/react-select

Hello,
Is there an example for es6 Multi Select or can someone please post a snippet if you have it handy. I appreciate very much

Most helpful comment

Is there something you'd specifically like to see? All components/options are compatible with ES6...

For example:

const { options, optionsLoading } = this.props; 
const { selectedOptions } = this.state; 
return (
  <Select
    value={ selectedOptions }
    isLoading={ optionsLoading }
    options={ options.map(({ id, name }) => ({ label: name, value: id })) }
    onChange={ (selectedOptions) => this.setState({ selectedOptions }) }
    multi />
);

All 2 comments

Is there something you'd specifically like to see? All components/options are compatible with ES6...

For example:

const { options, optionsLoading } = this.props; 
const { selectedOptions } = this.state; 
return (
  <Select
    value={ selectedOptions }
    isLoading={ optionsLoading }
    options={ options.map(({ id, name }) => ({ label: name, value: id })) }
    onChange={ (selectedOptions) => this.setState({ selectedOptions }) }
    multi />
);

Hello -

In an effort to sustain the react-select project going forward, we're closing old issues / pull requests.

We understand this might be inconvenient but in the best interest of supporting the broader community we have to direct our limited efforts to maintain the latest version.

If you feel this issue / pull request is still relevant and you'd like us to review it, please leave a comment and we'll do our best to get back to you.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

AchinthaReemal picture AchinthaReemal  路  3Comments

steida picture steida  路  3Comments

sampatbadhe picture sampatbadhe  路  3Comments

mjuopperi picture mjuopperi  路  3Comments

MalcolmDwyer picture MalcolmDwyer  路  3Comments