fix local

This commit is contained in:
Rizky 2024-04-21 13:20:07 +07:00
parent 07b8a86376
commit 1dee1838b4
2 changed files with 19 additions and 16 deletions

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
import { ReactNode, useEffect, useRef } from "react"; import { ReactNode, useEffect, useRef, useState } from "react";
import { IMeta } from "../../../ed/logic/ed-global"; import { IMeta } from "../../../ed/logic/ed-global";
import { updatePropScope } from "./eval-prop"; import { updatePropScope } from "./eval-prop";
import { modifyChild } from "./passprop"; import { modifyChild } from "./passprop";
@ -38,8 +38,11 @@ export const createViLocal = (
const ref = useRef<any>( const ref = useRef<any>(
editorLocalValue[id] ? editorLocalValue[id] : arg.value editorLocalValue[id] ? editorLocalValue[id] : arg.value
); );
const [_, set] = useState({});
const local = ref.current; const local = ref.current;
local.render = meta.render; local.render = () => {
set({});
};
updatePropScope(vi, meta, meta.script?.scope, parent_key); updatePropScope(vi, meta, meta.script?.scope, parent_key);