-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
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
[Link] Fix type declaration for props #14193
Conversation
Derive from AnchorHTMLAttributes to add anchor specific properties like href to prop types of Link. Otherwise typescript fails to recognize "href" or "target".
@lunaryorn @essuraj @oliviertassinari guys, seems after this PR an example from docs (
Here is a demo with in TS https://codesandbox.io/s/728zylw051 would you like to accept a PR with a fix? |
@havenchyk This is likely fixed in |
@eps1lon it works like a charm with |
Unfortunately there's no good solution that doesn't introduce a breaking change. You can search the pull request for "generic props" to get a better understanding of the issue. |
@eps1lon I'm sorry for asking here, but I can't find a way to define a type of It's generic in |
@havenchyk Have you checked out https://next.material-ui.com/components/links/#third-party-routing-library (open code and switch to the TS version). If this doesn't work please open a separate issue and follow the issue template |
Derive from AnchorHTMLAttributes to add anchor specific properties like
href
to prop types ofLink
. Otherwise tsc fails to compile when using arguably important properties likehref
andtarget
.