Relative Content

Tag Archive for reactjstypescriptnext.jsradixshadcnui

Shadcn/radix asChild throws `React.Children.only expected to receive a single React element child.`

<SelectTrigger asChild> <Button variant=”outline” role=”combobox” className={cn( “w-[200px] justify-between”, !field.value && “text-muted-foreground”, )} > <> {field.value ? getAllFormFactors.data?.find( (formFactor) => formFactor.id === field.value, )?.name : “Select form factor”} <ChevronsUpDown className=”ml-2 h-4 w-4 shrink-0 opacity-50″ /> </> </Button> </SelectTrigger> I tried replacing the button with a simple div, the error still throws, the error is gone once […]

Shadcn/radix asChild throws `React.Children.only expected to receive a single React element child.`

<SelectTrigger asChild> <Button variant=”outline” role=”combobox” className={cn( “w-[200px] justify-between”, !field.value && “text-muted-foreground”, )} > <> {field.value ? getAllFormFactors.data?.find( (formFactor) => formFactor.id === field.value, )?.name : “Select form factor”} <ChevronsUpDown className=”ml-2 h-4 w-4 shrink-0 opacity-50″ /> </> </Button> </SelectTrigger> I tried replacing the button with a simple div, the error still throws, the error is gone once […]