mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-17 12:56:05 +00:00
improved nextjs/remix adapters and docs, confirmed remix ssr working
This commit is contained in:
19
app/src/adapter/remix/AdminPage.tsx
Normal file
19
app/src/adapter/remix/AdminPage.tsx
Normal file
@@ -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