tjallingt/react-youtube

Youtube component disappearing immediately after page loads

lofti198 opened this issue ยท 8 comments

Youtube component is very cool, but disappearing immediately after page loads. Tested with example from here https://github.com/tjallingt/react-youtube . What can be the reason?

I had the same issue. The reason is the changed rendering of react 18. Need to wait for an update or use the old method

import ReactDOM from "react-dom"; 

ReactDOM.render(
  <React.StrictMode>
    <App/>
  </React.StrictMode>,
document.getElementById('root'));

instead of

import ReactDOM from "react-dom/client";

const root = ReactDOM.createRoot(document.getElementById('root') as HTMLElement);
root.render(
  <React.StrictMode>
    <App />
  </React.StrictMode>,
);

Thank you! It works just fine!

๐ŸŽ‰ This issue has been resolved in version react-youtube-v9.0.1-canary.2 ๐ŸŽ‰

The release is available on:

Your semantic-release bot ๐Ÿ“ฆ๐Ÿš€

๐ŸŽ‰ This issue has been resolved in version react-youtube-v9.0.2-canary.1 ๐ŸŽ‰

The release is available on:

Your semantic-release bot ๐Ÿ“ฆ๐Ÿš€

๐ŸŽ‰ This issue has been resolved in version react-youtube-v9.0.2 ๐ŸŽ‰

The release is available on:

Your semantic-release bot ๐Ÿ“ฆ๐Ÿš€

@lofti198 @avganka can you give version 9.0.2 a try? It should work with React 18 new strict mode.

@ruisaraiva19 yeah, thank you! Checked. Works great

Hey @ruisaraiva19, I see that you said it is fixed, but from what I can tell, the video is still being destroyed immediately onload and you are just reloading it. Do you have a fix where the video isn't loaded twice?