`ReactPlayer` not working in React 17
Current Behavior
When using the out-of-the-box ReactPlayer and provided any url, in this case it's a YouTube link, the React Player component fails to render and throws this error in the console.
Uncaught undefined
The above error occurred in one of your React components:
in Unknown (created by Player)
in Player (created by ReactPlayer)
in Suspense (created by ReactPlayer)
in div (created by ReactPlayer)
in ReactPlayer

Expected Behavior
The embedded YouTube video should be present on-screen.
Steps to Reproduce
- `import ReactPlayer from 'react-player'
- Render the component like
<ReactPlayer url={url} />whereurlis any link - View the thrown error in the console
Current packages
...
"react-player": "2.10.0",
"react": "17.0.2",
"react-dom": "17.0.2",
...
Other Information
I've seen similar issues in the past closed, but they don't seem to address my case since i'm not using @hot-loader/react-dom or NextJS:
- https://github.com/cookpete/react-player/issues/1176
- https://github.com/cookpete/react-player/issues/1165
Aw, since I updated react-dom to ^17.0.2 it works for me.
Interesting, I've cleared my node_modules cache and reinstalled them and I'm still getting the same bug. Any recommendations for debugging this?
I imported like this: import ReactPlayer from 'react-player/lazy';
Is anyone able to provide an example repo where this happens? I can spin up a fresh create-react-app and do not get this error on any 17.0.* version of react.
@cookpete Unfortunately, the repo where I'm experiencing these issues is private. I manage all my packages since I'm not using a solution like create-react-app. Would you know of other possible packages that could interfere with react-player to cause this issue?
@spereira2017 I can try to see if that works!