Commit 138a8447 authored by Chunchi Che's avatar Chunchi Che

fix

parent 988cd561
Pipeline #20270 passed with stages
in 4 minutes and 28 seconds
import React, { Suspense } from "react";
// 这个组件不知道为啥用不了,先保留后面研究下
const LazyLoad = (props: { lazy: React.ReactNode }) => {
return <Suspense fallback={<div>Loading...</div>}>{props.lazy}</Suspense>;
};
export const Loading = () => <div>Loading</div>;
export default LazyLoad;
import React, { Suspense } from "react";
import { Routes, Route } from "react-router-dom";
import LazyLoad from "./LazyLoad";
import LazyLoad, { Loading } from "./LazyLoad";
const Login = React.lazy(() => import("./Login"));
const WaitRoom = React.lazy(() => import("./WaitRoom"));
......@@ -14,15 +14,27 @@ export default function () {
<Route path="/" element={<LazyLoad lazy={<Login />} />} />
<Route
path="/room/:player/:passWd/:ip"
element={<Suspense fallback={<div>Loading...</div>}><WaitRoom /></Suspense>}
element={
<Suspense fallback={<Loading />}>
<WaitRoom />
</Suspense>
}
/>
<Route
path="/mora/:player/:passWd/:ip"
element={<Suspense fallback={<div>Loading...</div>}><Mora /></Suspense>}
element={
<Suspense fallback={<Loading />}>
<Mora />
</Suspense>
}
/>
<Route
path="/duel/:player/:passWd/:ip"
element={<Suspense fallback={<div>Loading...</div>}><NeosDuel /></Suspense>}
element={
<Suspense fallback={<Loading />}>
<NeosDuel />
</Suspense>
}
/>
</Routes>
);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment