Next.js Discord

Discord Forum

SheetContent error: Type '{ children: Element[]; side: "left"; className: string; }' is not assignab

Answered
Hassib posted this in #help-forum
Open in Discord
Avatar
I'm using the Sheet component shadcn/ui, and I'm facing the following error:

Type '{ children: Element[]; side: "left"; className: string; }' is not assignable to type 'IntrinsicAttributes & SheetContentProps & RefAttributes<unknown>'.
Property 'children' does not exist on type 'IntrinsicAttributes & SheetContentProps & RefAttributes<unknown>'.ts(2322)

Here's how I use it:

<Sheet>
  <SheetTrigger asChild>
    <Button
      variant="outline"
      size="icon"
      className="shrink-0 md:hidden"
    >
      <Menu className="h-5 w-5" />
      <span className="sr-only">Toggle navigation menu</span>
    </Button>
  </SheetTrigger>
  <SheetContent side="left" className="flex flex-col">
    {/* rest of the code */}
  </SheetContent>
</Sheet>   
Answered by Hassib
I removed and reinstalled the @radix-ui/react-dialog package and the issue has been solved.
View full answer

2 Replies

Avatar
Other than that, when I'm opening the sheet.tsx implementation, the @radix-ui/react-dialog throws Cannot find module '@radix-ui/react-dialog' or its corresponding type declarations.ts(2307) error while it's installed.

Note: I'm using the ^1.0.5 version.
Avatar
I removed and reinstalled the @radix-ui/react-dialog package and the issue has been solved.
Answer