This commit is contained in:
Rizky 2023-10-17 16:17:15 +07:00
parent 51361d0280
commit 1125dfd081
3 changed files with 9 additions and 3 deletions

View File

@ -73,7 +73,6 @@ export const LRenderInternal: FC<{
}, []);
if (!meta) {
console.log("meta not found", id);
return null;
}
meta.render = () => {

View File

@ -26,6 +26,8 @@ export const treePropEval = (
const w = window as any;
const finalScope = mergeScopeUpwards(p, id, { _scopeIndex });
const args = {
...w.exports,
...finalScope,

View File

@ -47,9 +47,14 @@ export const treeScopeEval = (
for (const [k, v] of Object.entries(finalScope)) {
if (v && typeof v === "object") {
const t: { _jsx: true; Comp: FC<{ parent_id: string }> } = v as any;
const t: {
_jsx: true;
Comp: FC<{ parent_id: string; _scopeIndex?: Record<string, any> }>;
} = v as any;
if (t._jsx && t.Comp) {
finalScope[k] = <t.Comp parent_id={meta.item.id} />;
finalScope[k] = (
<t.Comp parent_id={meta.item.id} _scopeIndex={_scopeIndex} />
);
}
}
}