import { h, Component } from 'preact'; import PropTypes from 'prop-types'; export default class Chat extends Component { static propTypes = { handleKeyDown: PropTypes.func.isRequired, handleSubmitOnClick: PropTypes.func.isRequired, activeChannelId: PropTypes.number }; shouldComponentUpdate(nextProps) { return this.props.activeChannelId != nextProps.activeChannelId; } render() { const { handleSubmitOnClick, handleKeyDown } = this.props; return (