import React, { PropTypes } from 'react'; const consoleMax = 5; class Console extends React.Component { constructor(props) { super(props); this.children = []; } shouldComponentUpdate(nextProps) { // clear children if paused, but only update when new consoleEvent happens if (!nextProps.isPlaying) { this.children = []; } return nextProps.consoleEvent !== this.props.consoleEvent; } render() { const args = this.props.consoleEvent.arguments; const method = this.props.consoleEvent.method; const nextChild = (