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 ( <>
点击试试看: {props.num}
> ); } app.getInitialProps = async () => { const data = await fetch("/api/list"); return { num: data.num }; }; function error({ message }) { returnErrorMessage: {message}
; } start(app, error);