import React, { Component } from "react"; import { Col, Container, Navbar, Row } from "react-bootstrap"; import Plot from "react-plotly.js"; import HCard from "./HCard"; import RPlot from "./RPlot"; import { RToast } from "./RToast"; import { NewTickData, socket } from "../"; type AppState = { current_price: number, current_tick: number, last_update: Date } class App extends Component { constructor(props) { super(props) } state = { current_price: 0, current_tick: 0, last_update: new Date() } componentDidMount() { socket.on("new_tick", (data: NewTickData) => { this.setState({ current_price: data.price, current_tick: data.tick, last_update: new Date() }) }) } render() { return ( ) } } export default App;