This commit is contained in:
Rizky 2023-10-17 07:17:47 +07:00
parent 835238ea11
commit b256d5bd5b
4 changed files with 8 additions and 6 deletions

View File

@ -31,6 +31,7 @@ export const routeLive = (p: PG, pathname: string) => {
}
}
console.log(page_id);
if (page_id) {
(window as any).prasiPageID = page_id;
const promises: Promise<void>[] = [];

View File

@ -5,6 +5,8 @@ import { ItemMeta, PG } from "./global";
import { mergeScopeUpwards } from "./tree-scope";
import { LItem } from "../elements/l-item";
import { extractNavigate, preload } from "./route";
import { createId } from "@paralleldrive/cuid2";
import { fillID } from "../../editor/tools/fill-id";
export type PropCompFC = FC<{}>;
@ -67,9 +69,9 @@ export const treePropEval = (
if (prop.content) {
if (p.treeMeta[prop.content.id]) {
p.treeMeta[prop.content.id].jsxParentId = parent_id;
}
return <LItem id={prop.content.id} fromProp={true} />;
return <LItem id={prop.content.id} fromProp={true} />;
}
}
return <></>;
},

View File

@ -18,7 +18,6 @@ const Root: FC<{ url: URL; Live: any }> = ({ url, Live }) => {
w.prasiContext.render = () => {
render({});
};
w.rootRender = w.prasiContext.render;
const Provider = GlobalContext.Provider as FC<{ value: any; children: any }>;
return (

View File

@ -9,7 +9,7 @@ export const defineWindow = async (awaitServerUrl = true) => {
w.prasiContext = {
global: {},
render() {},
};
};
const location = window["location"];
@ -88,9 +88,9 @@ export const defineWindow = async (awaitServerUrl = true) => {
w.preventPopRender = false;
return;
}
if (w.rootRender) {
if (w.prasiContext && w.prasiContext.render) {
w.pathname = location.pathname;
w.rootRender();
w.prasiContext.render();
}
});
}