New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Autocomplete] Add verbose warning for defaultValue #27925
[Autocomplete] Add verbose warning for defaultValue #27925
Conversation
9898167
to
a0427f2
Compare
'Autocomplete', | ||
); | ||
}).toErrorDev( | ||
'The Autocomplete expects the `defaultValue` prop to be an array or undefined.', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'The Autocomplete expects the `defaultValue` prop to be an array or undefined.', | |
'The Autocomplete expects the `defaultValue` prop to be an array when `multiple={true}` or undefined.', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, should I change the warning for value
prop too, because the condition under which we show the warning are same for both defaultValue
& value
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, should I change the warning for value prop too
@vedadeepta Yes please. It's the same warning, respectively for the controlled and uncontrolled behavior of the "value" state.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
too late now, should I open a different PR or re-open this one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A follow-up PR sounds great
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice warning, thanks!
Fixes: #24785