mirror of
https://github.com/bknd-io/bknd/
synced 2026-08-04 00:56:01 +00:00
improved nextjs/remix adapters and docs, confirmed remix ssr working
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
import { Suspense, lazy, useEffect, useState } from "react";
|
||||
|
||||
export function adminPage() {
|
||||
const Admin = lazy(() => import("bknd/ui").then((mod) => ({ default: mod.Admin })));
|
||||
return () => {
|
||||
const [loaded, setLoaded] = useState(false);
|
||||
useEffect(() => {
|
||||
if (typeof window === "undefined") return;
|
||||
setLoaded(true);
|
||||
}, []);
|
||||
if (!loaded) return null;
|
||||
|
||||
return (
|
||||
<Suspense>
|
||||
<Admin />
|
||||
</Suspense>
|
||||
);
|
||||
};
|
||||
}
|
||||
@@ -1 +1,2 @@
|
||||
export * from "./remix.adapter";
|
||||
export * from "./AdminPage";
|
||||
|
||||
Reference in New Issue
Block a user