import React from 'react';

class TestComponent extends React.Component {
  constructor(props) {
    super(props);
    this.state = {text: ''};
  }

  onChange = e => {
    this.updateText(e.target.value);
  };

  updateText = text => {
    this.setState({text: text});
  };

  render() {
    return (
      <div>
        <div>
          <h1>React lives!</h1>
        </div>
        Is React working? Test here: {this.state.text}
        <hr />
        <input onChange={this.onChange} />
      </div>
    );
  }
}

export default TestComponent;
