class SpeechBubble extends React.Component { constructor(props) { super(props); // props.kind ... speaking, thinking, asking this.state = { isFade: false }; } componentDidMount() { setTimeout(function () { //Start the timer this.setState({ isFade: true }) }.bind(this), 30) } render() { let click = (this.props.clickable) ? ' clickable' : ''; let fade = (this.state.isFade) ? ' fade' : ''; return (
{this.props.message}
); } }