From 71cd7bc41e3a6267223c813ccfd01e875fec985d Mon Sep 17 00:00:00 2001 From: qiqi Date: Wed, 2 Dec 2026 18:07:44 +0800 Subject: [PATCH] =?UTF-8?q?test:=20=E8=A1=A5=20useEffect=20=E6=A1=A9?= =?UTF-8?q?=EF=BC=88183=20=E8=B5=B7=E6=97=A2=E6=9C=89=E5=A4=B1=E8=B4=A5?= =?UTF-8?q?=EF=BC=8C=E4=B8=8E=E6=9C=AC=E8=BD=AE=E6=97=A0=E5=85=B3=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/result-img-doubleclick-test.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/result-img-doubleclick-test.js b/tests/result-img-doubleclick-test.js index c232627..ee3ab0c 100644 --- a/tests/result-img-doubleclick-test.js +++ b/tests/result-img-doubleclick-test.js @@ -14,6 +14,8 @@ const React = { return { type, props: Object.assign({}, props || {}, { children }) } }, useState(init) { return [init, function () {}] }, + // 183 起 ResultImg 用 useEffect 订阅落地状态;假 React 必须提供(既有失败,与本次回滚无关) + useEffect(fn) { try { const c = fn && fn(); if (typeof c === 'function') c() } catch (e) { /* ignore */ } }, } const sandbox = { React } vm.runInNewContext(fs.readFileSync(path.join(root, 'src', 'ui-components.js'), 'utf8'), sandbox)