Help! using listbox headless ui

i code like this and it show me this error, anyidea how?
9 Replies
Brendonovich
Brendonovich•2y ago
my guess is that selectedComic is being initialised as undefined, since comics?.[1] will be undefined while query loads, and while value is undefined React thinks that the component should be uncontrolled
arete
arete•2y ago
ahhh then how to make the initial value defined? 🤔
Brendonovich
Brendonovich•2y ago
does the same error happen if you remove the onChange handler? it may give u another error tbf maybe do useState(comics?.[1] ?? null), since null is an actual value in the eyes of react
arete
arete•2y ago
yeah it doesnt show any error
arete
arete•2y ago
but when its first load its show like this
Brendonovich
Brendonovich•2y ago
Hmm try setting a placeholder "Select Comic" or something
arete
arete•2y ago
LESGOOOWWWW
arete
arete•2y ago
arete
arete•2y ago
thank you bruvvv
Want results from more Discord servers?
Add your server