mirror of
https://github.com/NebulaServices/Nebula.git
synced 2025-05-17 05:20:01 -04:00
add suspense
This commit is contained in:
parent
6db77d4785
commit
c954fab097
3 changed files with 51 additions and 7 deletions
|
@ -1,16 +1,11 @@
|
|||
import { render } from "preact";
|
||||
import { Suspense, lazy } from "preact/compat";
|
||||
import { LoadSuspense } from "./LoadSuspense";
|
||||
const Routes = lazy(() => import("./routes"));
|
||||
|
||||
export default function App() {
|
||||
return (
|
||||
<Suspense
|
||||
fallback={
|
||||
<div>
|
||||
<div>loading...</div>
|
||||
</div>
|
||||
}
|
||||
>
|
||||
<Suspense fallback={<LoadSuspense />}>
|
||||
<div>
|
||||
<Routes />
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue