-
I noticed that the MultiValueContainer component takes MultiValueGenericProps but seems to lack the common props like setValue, as per the documentation on https://react-select.com/components. I'm working with TypeScript and have resorted to using custom selectProps to manually pass in the setValue function. Is there a more straightforward way to do this that I might be overlooking? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I don't think there's a more straightforward way to access setValue within MultiValueContainer. It's not provided access to some of the common props like setValue or clearValue, which can make it kind of inflexible if you want to perform those types of actions within the component. Passing those methods manually via selectProps is probably the best way. It's a bit of a manual override, but it works within the flexibility that react-select provides. |
Beta Was this translation helpful? Give feedback.
I don't think there's a more straightforward way to access setValue within MultiValueContainer. It's not provided access to some of the common props like setValue or clearValue, which can make it kind of inflexible if you want to perform those types of actions within the component.
Passing those methods manually via selectProps is probably the best way. It's a bit of a manual override, but it works within the flexibility that react-select provides.