import React, { useEffect } from "react"; import { observer } from "mobx-react-lite"; import Link from "next/link"; import { IStore, useStore } from "../store"; import Clock from "./Clock"; interface IOwnProps { store?: IStore; title: string; linkTo: string; } const SampleComponent: React.FC = observer((props) => { const { lastUpdate, light, start, stop } = useStore(props.store); useEffect(() => { start(); return () => { stop(); }; }, [start, stop]); return (

{props.title}

); }); export default SampleComponent;