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

[ButtonBase] typescript error on props passed to component={CustomComponent} when composing #43872

Closed
croraf opened this issue Sep 24, 2024 · 2 comments
Assignees
Labels
component: ButtonBase The React component. customization: slot Component's slot customizability status: waiting for author Issue with insufficient information typescript

Comments

@croraf
Copy link
Contributor

croraf commented Sep 24, 2024

Steps to reproduce

Link to live example: https://codesandbox.io/p/sandbox/shy-night-xv2tjm?file=%2Fsrc%2FDemo.tsx%3A49%2C9-49%2C65

Current behavior

Notice the a prop errors out.

Expected behavior

Shouldn't it understand that a is available on component prop?

Context

No response

Your environment

No response

Search keywords: Button typescript ButtonBase

@croraf croraf added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Sep 24, 2024
@siriwatknp siriwatknp added customization: slot Component's slot customizability typescript component: ButtonBase The React component. labels Sep 24, 2024
@mnajdova
Copy link
Member

mnajdova commented Oct 2, 2024

In order for this to work you should cast your Button1 component to typeof Button. See this example: https://codesandbox.io/p/sandbox/admiring-drake-fgj3r5?file=%2Fsrc%2FDemo.tsx%3A27%2C39

@mnajdova mnajdova added status: waiting for author Issue with insufficient information and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Oct 2, 2024
Copy link

github-actions bot commented Oct 9, 2024

Since the issue is missing key information and has been inactive for 7 days, it has been automatically closed. If you wish to see the issue reopened, please provide the missing information.

@github-actions github-actions bot closed this as completed Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: ButtonBase The React component. customization: slot Component's slot customizability status: waiting for author Issue with insufficient information typescript
Projects
None yet
Development

No branches or pull requests

4 participants