Simple Dropdown component not taking the initial default #1722
Answered
by
KirilCycle
kawoolutions
asked this question in
PrimeReact
-
Hello. I'm quite new to React, so beware. I am trying to build a simple dropdown representing sports seasons:
However, the initial/default season is not selected when reloading the page: It initially shows "No season selected", but this should not be possible at all. A season must be selected. What's wrong? How do I fix this? Thanks |
Beta Was this translation helpful? Give feedback.
Answered by
KirilCycle
May 28, 2024
Replies: 1 comment
-
Hello, since you want to store the entire object in the 'selectedSeason' state, there is no need to maintain the 'optionValue' property in 'Dropdown' component. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
melloware
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello, since you want to store the entire object in the 'selectedSeason' state, there is no need to maintain the 'optionValue' property in 'Dropdown' component.