-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
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
[styles] Allow ref on withTheme components in TS #17695
Conversation
No bundle size changes comparing 5d564f9...f8e0f19 |
I just realized that this is probably the wrong place. The This would now imply that you have access inside your component to interface Props extends WithTheme {}
function Component(props: Props) {
const {ref} = props; // whoops, this can never happen
}
export default withTheme(Component); Could you add a usage example that would be allowed with this change (i.e. a test) to https://github.com/mui-org/material-ui/blob/2bcc874cf07b81202968f769cb9c2398c7c11311/packages/material-ui-styles/test/styles.spec.tsx#L70? |
@ianschmitz Did you had the chance to look at the problem? |
Oh shoot sorry I lost track of this. I'll take a look today! |
`withTheme` now forwards refs, but the typing for the `ref` prop is missing in the declaration file.
Alright I've updated it. I think it's what you were after. I've also updated Not super happy with the typings in |
Also a question. I noticed |
@ianschmitz Perfect, thanks! |
withTheme
now forwards refs, but the typing for theref
prop is missing in the declaration file.