<div id='root'></div>
button {
  width:100px;
  height:50px;
}
function Button(props) {
  return (
    <button onClick={props.onClick}>
      {props.text}
    </button>
  )
}

class View extends React.Component {
  constructor(props) {
    super(props);
    this.state = {isClicked: true};
  }
  handleClick = () => {
    this.setState({isClicked: !this.state.isClicked});
  }
  render() {
    return (
      <div>
        <Button
          onClick={this.handleClick}
          text={this.state.isClicked
                ? 'Вы записаны'
                : 'Записаться'}/>
        <Button
          onClick={() => {}}
          text={this.state.isClicked
                ? 'Отправлено'
                : 'Отправить'}/>
      </div>
    )
  }
}

ReactDOM.render(
  <View />, 
  document.querySelector('#root')
);
View Compiled

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

  1. https://cdnjs.cloudflare.com/ajax/libs/react/15.3.1/react.js
  2. https://cdnjs.cloudflare.com/ajax/libs/react/15.3.1/react-dom.min.js
  3. https://cdnjs.cloudflare.com/ajax/libs/Swiper/4.5.0/js/swiper.min.js