-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
Callbacks for click, hover, keydown #167
Comments
Yeah an object of props to attach to the wrapper div makes sense. What name would make sense though? <ReactPlayer
url='file.mp3'
events={{
onClick: () => {},
onMouseOver: () => {}
}}
/> Maybe |
In my experience, I think most components just pass through any other props with just the spread syntax after slicing off the props they needed. So, I feel like we might not even need a wrapper unless you feel it is cleaner. |
There is already a wrapper div here that we can attach stuff to. The problem is that using the spread syntax would require something like const { url, playing, volume, blah, blah, blah, ...extra } = this.props which would be huge and impractical considering the amount of props we have. That's why I'm thinking something like <div style={...} className={...} {...attributes} /> for the wrapper. |
Hey @cookpete! So far, things have been going great while integrating with
react-player
but ran into a small roadblock. I was trying to implement -onClick
onMouseOver
/onMouseOut
onKeyDown
But it seems none of these events are exposed at the moment. My current workaround is to have a
div
aroundReactPlayer
and tying all the callbacks to thatdiv
but it isn't the nicest solution.Thoughts? Do you think these can be exposed?
Thank you!
The text was updated successfully, but these errors were encountered: