`RadioGroup.Item` and `RadioCards.Item` accept `checked` prop
kevinmitch14 opened this issue · comments
Yes, the value
prop on the Root part is the source of truth. I'll double check the Radio Group and Radio Cards, don't think those should have the checked prop
Gotcha, in my case we are using them as a sort of stepper. So if step1 is completed, the CheckboxCards.Root
value should have "step1"
in it and so on.
But I can't do the following: step1Completed can be string | undefined
and you can't assign undefined to string.
// Type 'string | undefined' is not assignable to type 'string'.
<CheckboxCards.Root value={[step1Completed && "step1", step2Completed && "step2"]}>
So I am doing the following to keep typescript happy but it seems like a hacky solution:
<CheckboxCards.Root value={[step1Completed ? "step1": "_", step2Completed ? "step2": "_"]}>
Edit: I'm prob not going to continue using this method, but just thought I would raise it here.