Open gnoyixiang opened 6 months ago
Getting this typescript error when using Select.Portal "Property 'className' does not exist on type 'IntrinsicAttributes & SelectPortalProps'."
Select.Portal
Since className is actually passed down to Portal component and the DOM. Since it is used, this prop should be accepted in the Select.Portal props
className
Replit Template
Revert the changes made in this PR interface SelectPortalProps extends Omit<PortalProps, 'asChild'> {
interface SelectPortalProps extends Omit<PortalProps, 'asChild'> {
"devDependencies": { "@types/react": "^18.0.15", "@types/react-dom": "^18.0.6", "@vitejs/plugin-react": "^2.0.0", "react": "^18.2.0", "react-dom": "^18.2.0", "typescript": "^4.7.4", "vite": "^3.0.4" }, "dependencies": { "@radix-ui/colors": "^3.0.0", "@radix-ui/react-icons": "^1.3.0", "@radix-ui/react-select": "^2.0.0", "classnames": "^2.5.1" }
why do you want to pass className to Select.Portal? Selected.Portal will be merged with Select.Content so you can pass the className directly to Select.Content
Selected.Portal
Select.Content
Bug report
Current Behavior
Getting this typescript error when using
Select.Portal
"Property 'className' does not exist on type 'IntrinsicAttributes & SelectPortalProps'."Expected behavior
Since
className
is actually passed down to Portal component and the DOM. Since it is used, this prop should be accepted in theSelect.Portal
propsReproducible example
Replit Template
Suggested solution
Revert the changes made in this PR
interface SelectPortalProps extends Omit<PortalProps, 'asChild'> {
Your environment