-
Notifications
You must be signed in to change notification settings - Fork 28
Add ref support to withTheme HOC #915
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
Conversation
Published version: @draftbit/[email protected] |
Published version: @draftbit/[email protected] |
}; | ||
) => { | ||
return React.forwardRef( | ||
(props: Omit<Props, "theme">, ref: React.Ref<any>) => { |
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.
With components that need a forwarded ref, I usually don't wrap them in a withTheme
, instead I get the theme by using the useTheme
hook and just export them as is. See the AudioPlayerWithInterface.tsx
for example. By doing that, the type of the ref can be maintained and is not any
like it is here. This works as well though, it'll just lose the type, but I'm fine with merging it
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.
Thanks, adjust BottomSheet component
Published version: @draftbit/[email protected] |
Overview
Demo
Screen.Recording.2024-08-07.at.10.14.39.mov