react-select-plus icon indicating copy to clipboard operation
react-select-plus copied to clipboard

How do we use option groups?

Open zaweb opened this issue 7 years ago • 2 comments

This is just a documentation issue.

I've been experimenting with react-select-plus, and it looks like it does exactly what I need. However, it's unclear to me how to use the "option groups" feature. You have an example of option groups on your Demos page, but I cannot find anything in your documentation/README on how to use it.

Not an urgent issue, just would like to understand how to take advantage of that feature. Thanks!

zaweb avatar May 06 '17 19:05 zaweb

It's all about you you structure your data. It's pretty easy to use. Here's an example (using ES6) with the ability to create multiple values, and new values. These it just props.

I've put my example in a codesandbox for your ease.

https://codesandbox.io/s/483orJ5Wk

yarnball avatar May 12 '17 02:05 yarnball

The example source code is easy to find in the repo as well!

https://github.com/HubSpot/react-select-plus/blob/master/examples/src/components/GroupedOptionsField.js

danielpowell4 avatar Mar 20 '18 16:03 danielpowell4