import React from 'react'; import Input from './Input'; import Send from './Send'; interface Props { lines: string[], } interface State { messageToSend: string } export default class Room extends React.Component { constructor(props: Props) { super(props); this.state = { messageToSend: '' }; } render() { return (
{ this.setState({ messageToSend: msg }); } } />
{this.renderLines(this.props.lines)}
); } renderLines(lines: string[]) { const renderedLines = []; for (const line of lines) { renderedLines.push(
{line}
); } return (
{renderedLines}
); } }