-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Allow overriding style on web #4333
base: master
Are you sure you want to change the base?
Allow overriding style on web #4333
Conversation
I'm just wondering- if you have a react-native app you have one |
If you're referring to the testing, then I've tested it; I assumed the the |
Sorry, I'm not sure why my comment was cut off. What I meant was: if you have a Video component in your app that works for both web and native, do the types work correctly? Do they change, for example, when you use Platform.select? Also, what is the default type in that case? |
If this is about the typing change, then I did not test that, I needed to send an empty style |
style?: CSSProperties; | ||
} | ||
|
||
export type WebReactVideoProps = Omit<ReactVideoProps, 'style'> & WebStyleProp; |
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.
why don't you patch directly ReactVideoProps instead of creating WebStyleProp in this common file ?
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.
something like:
type CustomViewProps = Omit<ViewProps, 'style'> & {
style?: ViewProps['style'] | CSSProperties;
};
export interface ReactVideoProps extends ReactVideoEvents, CustomViewProps {
|
I purposely omitted the style props because this is not compatible with react native styles. this means you'll need a different style for web & native. Since types are different, Maybe we could add a |
Another option is to add a prop that will have |
Summary
Allow overriding style on web
Motivation
When overriding the
style
with{}
we can allow the (web) video to resize to its real size without further effort.Changes
Sending
style
will now affect video on web.Test plan
I assume that if someone is already sending
style
this can affect them, however the release of the web support was quite recent so I'm not sure how risky this is; not sure how to test it though...