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.isRequired, }; shouldComponentUpdate(nextProps) { const { activeChannelId } = this.props; return activeChannelId !== nextProps.activeChannelId; } render() { const { handleSubmitOnClick, handleKeyDown } = this.props; return (