Skip to content
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

className props was removed #247

Closed
polco opened this issue Oct 9, 2017 · 2 comments
Closed

className props was removed #247

polco opened this issue Oct 9, 2017 · 2 comments

Comments

@polco
Copy link

polco commented Oct 9, 2017

I saw in the last update that 'className' was removed from the props in the typescript types. That property was very important since it allows to access and manipulate the style of the ReactPlayer component. Is there a preferred way to deal with this ? i would rather not create another div (since the component already creates 2 of those) around it just to style it.

@cookpete
Copy link
Owner

As of, d8df671, any props not specified in props.js get applied to the ReactPlayer wrapper div. So className still works as before, but just isn't specified as it just gets passed through with any other extra props.

I guess I need to update the typings file to include an indexer, to allow for any other props? Correct me if I'm wrong – I am not too clued up on TypeScript typings:

export interface ReactPlayerProps {
  url?: string | string[] | SourceProps[];
  playing?: boolean;
  loop?: boolean;
  // ...
  [otherProps: string]: any;
}

@polco
Copy link
Author

polco commented Oct 13, 2017

I tried adding the actual attributes types from the react types package, but a few properties of the ReactPlayer props (onProgress, onError, ...) conflicts with the DOMAttributes interface which has different definitions for those. So I guess you general indexer is our only solution for now :/

david-hub024 pushed a commit to david-hub024/React_VideoPlayer that referenced this issue Dec 23, 2018
david-hub024 pushed a commit to david-hub024/React_VideoPlayer that referenced this issue May 23, 2020
albanqoku added a commit to albanqoku/react-player that referenced this issue Feb 24, 2021
Webmaster1116 added a commit to Webmaster1116/video-player that referenced this issue May 20, 2021
webmiraclepro added a commit to webmiraclepro/video-player that referenced this issue Sep 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants