This is a problem with destructive libraries. Basically, you render the <video> element, and then VideoJS introduces a few sibling elements next to your <video> (child elements are ok).
React is trying to update the element, and it cannot understand what is happening, so it panics and gives this error.
So, you have two options:
Option 1: render <div ref="target" /> , build a video node in the this.refs.target.appendChild(that) component and this.refs.target.appendChild(that) , and then call VideoJS manually. In the WillRecieveProps component, you need to update the img src poster directly.
Option 2: fork video.js and do this only to generate events instead of directly modifying the DOM. Your component will respond to these events, change the state and rendering of the poster, buttons, etc.
Option 1 is simpler; option 2 is potentially more efficient and clean. I would choose option 1.
None of them is a good solution, but libraries that exit their container do not respond very well to the reaction.
Brigand
source share