title: How to clone a react component?
body: <p>I am implementing the Picture-in-Picture function of my media player component.</p>
  <p>My code is <a href="https://stackblitz.com/edit/react-esdfhm?file=buttons%2FMuteButton.js" rel="nofollow noreferrer">here</a>.</p>
  <p>I want to forward the mute state of the original player to the mini-player.</p>
  <p>Unfortunately, there are some problems that occurred in the Chrome browser,</p>
  <p>I found that if I popup the mini-player first, and then toggle the mute state in the original player,</p>
  <p>the mini-player mute state can follow the original player.</p>
  <p>If I unmute the original player first, and then popup the mini-player, the mini-player mute state <strong>cannot</strong> follow the original player.</p>
  <p>However, in the Firefox browser, the mini-player mute state can match with the original mute state all the time.</p>
  <p>I have tried to change the render method of the MediaPlayer class as follow:</p>
  <pre><code>render(){
      var media;
      if (this.state.showMiniPlayer){
          media=this.normalPlayer.media;
      } else {
          media=null;
      }   
      return (
          &lt;Fragment&gt;
              &lt;NormalPlayer
                  muted={this.state.muted} 
                  ref={instance =&gt; { this.normalPlayer = instance; }}
                  showFullScreen={this.state.showFullScreen}  
                  showMiniPlayer={this.state.showMiniPlayer}
                  toggFullScreen={this.toggFullScreen} 
                  toggleMute={this.toggleMute}
                  togglePInP={this.togglePInP}&gt;
              &lt;/NormalPlayer&gt;
              {media}
          &lt;/Fragment&gt;    
      )
  }
  </code></pre>
  <p>However, I got the following message:</p>
  <pre><code>Uncaught Error: Objects are not valid as a React child  
  </code></pre>
  <p>So, how can I fix the problem?</p>
  <p>The following screenshot is for Pavan Kalyan:
  <a href="https://i.stack.imgur.com/97Xes.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/97Xes.png" alt="enter image description here" /></a></p>