[Typescript] Button do not accept custom component
See original GitHub issue- [ x] The issue is present in the latest release.
- [ x] I have searched the issues of this repository and believe that this is not a duplicate.
Current Behavior 😯
<Button component={Link} variant="outlined" size="small">
Sign in
</Button>
Expected Behavior 🤔
It should be able to pass component

Steps to Reproduce 🕹
Steps:
Context 🔦
Your Environment 🌎
//tsconfig.json
{
"compilerOptions": {
"allowJs": true,
"baseUrl": ".",
"emitDecoratorMetadata": true,
"esModuleInterop": true,
"experimentalDecorators": true,
"forceConsistentCasingInFileNames": true,
"jsx": "preserve",
"lib": ["dom", "dom.iterable", "esnext"],
"module": "esnext",
"skipLibCheck": true,
"moduleResolution": "node",
"noEmit": true,
"noFallthroughCasesInSwitch": true,
"paths": {
"@/*": ["./*"]
},
"removeComments": true,
"resolveJsonModule": true,
"sourceMap": true,
"strict": true,
"strictPropertyInitialization": false,
"target": "esnext",
"isolatedModules": true
}
}
| Tech | Version |
|---|---|
| Material-UI | v4.3.1 |
| React | 16.8.6 |
| Browser | |
| TypeScript | 3.5.3 |
| etc. |
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (3 by maintainers)
Top Results From Across the Web
[Typescript] Button do not accept custom component #16887
[ x] The issue is present in the latest release. [ x] I have searched the issues of this repository and believe that...
Read more >How to Build a Custom Button Component in React TypeScript
Follow best programming practices by learning how to write a reusable custom button component for a basic TypeScript React project.
Read more >How to prevent clicks to custom button component in Angular 4
You can use @HostBinding('class') and :host -selectors to disable clicks via pointer-events: none based on your shouldBeDisabled property:
Read more >Making your components extensible with TypeScript
The <Button /> we have so far isn't really useful, is it? So, let's add some custom properties. Adding custom properties. For the...
Read more >Useful Patterns by Use Case - React TypeScript Cheatsheets
ComponentPropsWithoutRef<'button'>. // usage function App() { // Type '"foo"' is not assignable to type '"button" | "submit" | "reset" | undefined'.(2322)
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

The solution is not working if you’re using the styled-components
I confirm same issue with Button and styled components in version
I am consuming styled button as below
Button wrapped as Styled component
Error
Here is code sandbox replicating same issue. https://codesandbox.io/s/mui-styled-button-vliel?file=/src/App.tsx @oliviertassinari appreciate your help here again as this is blocking 👏