add sleep
This commit is contained in:
@@ -1,8 +1,11 @@
|
||||
import { Suspense } from "react";
|
||||
import { useNavigation } from "react-router";
|
||||
import { Link } from "react-router";
|
||||
import { Outlet } from "react-router";
|
||||
|
||||
export default function Layout() {
|
||||
const navigation = useNavigation();
|
||||
const isNavigating = Boolean(navigation.location);
|
||||
|
||||
return (
|
||||
<>
|
||||
<ul>
|
||||
@@ -13,9 +16,7 @@ export default function Layout() {
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<Suspense fallback={<div>Loading...</div>}>
|
||||
<Outlet />
|
||||
</Suspense>
|
||||
{isNavigating ? <>Loading...</> : <Outlet />}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user