import { useState } from "react"; import { start } from "maxt"; import fetch from "maxt-fetch"; import "./index.scss"; function app(props: any) { const [info, setInfo] = useState({ name: "Maxt" }); return ( <>

{ setInfo(null); }} > Hello {info.name}

点击试试看: {props.num}

); } app.getInitialProps = async () => { const data = await fetch("/api/list"); return { num: data.num }; }; function error({ message }) { return

ErrorMessage: {message}

; } start(app, error);