import React, { Component } from 'react'; import { FunctionComponent } from 'react'; import { Card, Col, Row } from 'react-bootstrap'; type CardProps = { title: string, content: string } type CardState = { lastUpdate: Date } class HCard extends Component { constructor(props: CardProps) { super(props) } tick() { this.setState({ lastUpdate: new Date() }) } componentWillMount() { this.tick() } componentDidMount() { setInterval(() => this.tick(), 1000) } render() { return (

{this.props.title}

{this.props.content}
Last updated {this.state.lastUpdate.toLocaleTimeString('en-GB')}
); } } export default HCard;