Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue[Dialog] #1624

Closed
KOFI-GYIMAH opened this issue Sep 29, 2023 · 4 comments
Closed

issue[Dialog] #1624

KOFI-GYIMAH opened this issue Sep 29, 2023 · 4 comments

Comments

@KOFI-GYIMAH
Copy link

Property 'className' does not exist on type 'DialogPortalProps'.

@StepAsideLiL
Copy link

For context, this error occurred during the deployment to Vercel.

@StepAsideLiL
Copy link

Ok, I have a solution.
Go to the file dialog.tsx (/components/ui/dialog.tsx) and remove className from lines 14 and 17.
Here is the current code

const DialogPortal = ({
  className,
  ...props
}: DialogPrimitive.DialogPortalProps) => (
  <DialogPrimitive.Portal className={cn(className)} {...props} />
)

And here is the changed code

const DialogPortal = ({ ...props }: DialogPrimitive.DialogPortalProps) => (
  <DialogPrimitive.Portal {...props} />
)

If you have Sheet component, the same changes must be made on the file sheet.tsx (/components/ui/sheet.tsx).
Remove className from lines 17 and 20.
Here is the current code

const SheetPortal = ({
  className,
  ...props
}: SheetPrimitive.DialogPortalProps) => (
  <SheetPrimitive.Portal className={cn(className)} {...props} />
)

And here is the changed code

const SheetPortal = ({ ...props }: SheetPrimitive.DialogPortalProps) => (
  <SheetPrimitive.Portal {...props} />
)

@hirowf
Copy link

hirowf commented Sep 29, 2023

Thanks, this is solve, but some PR to fix it?

@lachieh
Copy link
Contributor

lachieh commented Oct 10, 2023

Closed with #1603 and released in 0.4.1. To resolve, run:

npx shadcn-ui@latest add dialog

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants