-
-
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
TypeError: Cannot read property 'play' of undefined #909
Comments
I'm guessing the The prop change in the test will attempt to do I guess the solution is to use |
hm. I can try to test with shallow. |
I have the same issue using I'm changing the
I've managed to work around it by listening for function Video({ src, autoplay }) {
const [ready, setReady] = React.useState(false)
const { ref, wasInViewport } = useWasInViewport({ threshold: [0.66] })
return (
<ReactPlayer
onReady={() => setReady(true)}
url={src}
muted={autoplay}
playing={autoplay && ready && wasInViewport}
controls
/>
)
} |
Current Behavior
When you change the
playing
prop during test (using Jest), the following error is thrown.TypeError: Cannot read property 'play' of undefined
Expected Behavior
No Error to be thrown
Steps to Reproduce
React component
Test File
Environment
The text was updated successfully, but these errors were encountered: