<div id="root"></div>
class Body extends React.Component {
  constructor(props) {
    super(props);
  }
  render() {
    return <div>{this.props.content}</div>;
  }
}

class App extends React.Component {
  state = { content : "body"}
  changeContent(value){
    this.setState({
      content:value
    })
  }
  render() {
    return (
      <div>
        <Body content={this.state.content} />
        <input type="text" onChange={(e)=>this.changeContent(e.target.value)} />
      </div>
    );
  }
}

ReactDOM.render(<App />, document.getElementById("root"));
View Compiled

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

  1. https://cdnjs.cloudflare.com/ajax/libs/react/16.9.0/umd/react.production.min.js
  2. https://cdnjs.cloudflare.com/ajax/libs/react-dom/16.8.6/umd/react-dom.production.min.js