import React from 'react'; import classnames from 'classnames'; class Warning extends React.Component { constructor(props, context) { super(props, context); this.handleClick = this.handleClick.bind(this); this.state = { expanded: false }; } handleClick() { this.setState(prevState => ({ expanded: !prevState.expanded })); } render() { const { text } = this.props; const { expanded } = this.state; const className = classnames('warning', { 'warning-expanded': expanded }); return (