Open manasvi-pandey opened 7 months ago
I don't think it's the problem with the shadcn/ui code
For those who come across this issue – I had the exact same problem in my monorepo (turbo/pnpm workspaces).
The issue was there was a dependency version mismatch between my @app/ui
package and my @app/web
package for @types/react
.
The version in my @app/ui
was 18.2.74 whilst in @app/web
it was 18.2.75. Updating @app/ui
to 18.2.75 resolved the issue.
Thank you @NickMandylas
Describe the bug
After installing the DropdownMenu component from
shadcn/ui
, there are a lot of type errors which stops the application from building (NextJS application to be specific)The type errors also occur when we try to use
DropdownMenuItem
in our code like belowAnd the error reads as follow
Type '{ children: string; }' has no properties in common with type 'IntrinsicAttributes & Omit<DropdownMenuLabelProps & RefAttributes<HTMLDivElement>, "ref"> & { ...; } & RefAttributes<...>'.
Affected component/components
DropdownMenu, Menubar
How to reproduce
npx shadcn-ui@latest add dropdown-menu
@/components/ui/dropdown-menu
Codesandbox/StackBlitz link
No response
Logs
No response
System Info
Before submitting