[typescript] Smarter logic?
See original GitHub issueProblem description
Button
has href
prop. If that prop is set, a
element is used to render the button (https://material-ui-1dab0.firebaseapp.com/api/button/). It would be nice if Button
had also target
property.
Versions
- Material-UI: 1.0.0-beta.8
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:30 (24 by maintainers)
Top Results From Across the Web
Smarter breadth first search logic? : r/typescript - Reddit
I don't want to overrule TypeScript whenever possible but for a breadth first search logic I had to overrule TypeScript and idk if...
Read more >The starting point for learning TypeScript
Find TypeScript starter projects: from Angular to React or Node.js and CLIs.
Read more >[typescript] Smarter logic? #8063 - mui/material-ui - GitHub
Problem description Button has href prop. If that prop is set, a element is used to render the button ...
Read more >TypeScript Tutorial: A step-by-step guide to learn TypeScript
It is smart enough to figure out types from their values. That way, you won't have to specify your types in your code....
Read more >13. TypeScript is really smart - YouTube
typescript #tutorials #cse #easylearning #whatistypescriptTypeScript is an open-source programming language advanced and maintained by ...
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
A better alternative where you will not risk a property collision:
I have always considered the below pattern an elegant “hack” (it’s harder to understand). But what if both
ListItem
andLink
implement a disabled property that you don’t want to share the same value between? You use the pattern above, not below.It’s also why you won’t find this third API with Material-UI. It’s a tradeoff between the two previous ones that suffer limitations without being much simpler.
@mctep That looks fine to be, but it should be noted that inline lambdas are highly unperformant. If I were to write docs for this I would write it as: