Can options and groups by mixed in the options prop? #5077
Unanswered
acarroll-trend
asked this question in
Q&A
Replies: 1 comment 1 reply
-
They can be mixed in advanced scenarios. See the date picker example and it's corresponding source code. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The
OptionsOrGroups
type is typed likewhich means that the following is valid
I've always assumed (which is why I'm asking), that the options prop must be either options xor groups, not mixed. If that assumption is true, then I think this type is more appropriate.
When we upgraded to v5, usage of our isGrouped type guard broke. The code still works, because our data is guaranteed to be 1 or the other.
TL;DR Is the type incorrect, or have I been thinking about this incorrectly all along?
Beta Was this translation helpful? Give feedback.
All reactions