not_null.
TTCTheo's Typesafe Cult
•Created by not_null. on 12/5/2022 in #questions
typescript props as object or array
Hey guys, I have a select that can or not be a multi-select
So my select props are
so I can take a SelectItem or an array of those
my problem is in the `setSelectedItem
when I call my component
I got the error
I understand that the problem is something to do with it either being an object or an array and so it has different properties
How can I make it typesafe and satisfy both cases?
5 replies