Skip to content

CreatableSelect and grouped options? #5533

Answered by st0w
st0w asked this question in Q&A
Discussion options

You must be logged in to vote

So just to follow up in case anyone else run into this... it seems this actually is possible. The problem I was running into is that there are two different importable objects named CreateableSelect. My IDE had imported the wrong one and I didn't realize it.

The incorrect one is:
import CreateableSelect from 'react-select'

While this loaded a functioning grouped/multiselect, it did not allow creating new items.

This is the correct import, as displayed in the documentation:

import CreateableSelect from 'react-select/creatable'

I'm going to use a modal hooked into onCreateOption to display my groups using CreateableSelect to allow selection/creation of new groupings.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by st0w
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant