Why react-select default value provided but still error when required is true #1757
-
Here are demonstration for this issue Here are two question
I expected to get {
"fruit": "apple"
} instead of {
"fruit": {
"value": "apple",
"label": "Apple"
}
} Thanks ❤️🙏 |
Beta Was this translation helpful? Give feedback.
Answered by
bluebill1049
Jun 2, 2020
Replies: 1 comment 13 replies
-
|
Beta Was this translation helpful? Give feedback.
13 replies
Answer selected by
bluebill1049
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
you didn't do anything with
defaultVal
, noting is really selected it just appear to be apple is first in the selection.that's the data return by react-select, to modify that you need to build a wrapper, so it only returns value, not the whole object.