-
-
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
[core] Try alternative to OverrideComponent
type (ver 2)
#33964
[core] Try alternative to OverrideComponent
type (ver 2)
#33964
Conversation
…hub.com/mnajdova/material-ui into feat/overridable-component-improvements
@@ -7,7 +7,7 @@ interface MyOverrideProps { | |||
myString?: string; | |||
myCallback?(n: number): void; | |||
} | |||
declare const MyOverrideComponent: React.ComponentType<MyOverrideProps>; | |||
declare const MyOverrideComponent: React.FunctionComponent<MyOverrideProps>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs to be double checked, for some reason I needed to change the type from ComponentType
to FunctionComponent
.
@@ -106,10 +106,12 @@ const Link = React.forwardRef<HTMLAnchorElement, LinkProps>(function Link(props, | |||
const nextjsProps = { to: href, linkAs, replace, scroll, shallow, prefetch, locale }; | |||
|
|||
if (noLinkStyle) { | |||
// @ts-ignore TODO: this needs to be resolved |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's interesting that in both implementations these ts-ignores are required.
I am closing it turned out to be a dead end |
Alternative of #32735. Inspired by https://github.com/radix-ui/primitives/blob/2f139a832ba0cdfd445c937ebf63c2e79e0ef7ed/packages/react/polymorphic/src/polymorphic.ts
Can't really see some notable difference:
master:
PR:
