You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 below
And the error reads as follow Type '{ children: string; }' has no properties in common with type 'IntrinsicAttributes & Omit<DropdownMenuLabelProps & RefAttributes<HTMLDivElement>, "ref"> & { ...; } & RefAttributes<...>'.
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.
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
The text was updated successfully, but these errors were encountered: