From f136597edd2a110fc1950b280c62bb483ceaccae Mon Sep 17 00:00:00 2001 From: amsyarasyiq <82711525+amsyarasyiq@users.noreply.github.com> Date: Sat, 25 May 2024 07:45:38 +0800 Subject: [PATCH] fix(polyfill/vendetta): unproxy some components --- src/core/polyfills/vendettaObject.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/core/polyfills/vendettaObject.ts b/src/core/polyfills/vendettaObject.ts index 97bc4be..ee74c3c 100644 --- a/src/core/polyfills/vendettaObject.ts +++ b/src/core/polyfills/vendettaObject.ts @@ -14,6 +14,7 @@ import * as metro from "@metro"; import * as common from "@metro/common"; import { Forms } from "@metro/common/components"; import * as commonComponents from "@metro/common/components"; +import { getFindContext } from "@metro/proxy"; import * as alerts from "@ui/alerts"; import * as color from "@ui/color"; import * as components from "@ui/components"; @@ -142,10 +143,10 @@ export const initVendettaObject = (): any => { components: { Forms, General: common.ReactNative, - Alert: commonComponents.Alert, - Button: commonComponents.Button, - HelpMessage: commonComponents.HelpMessage, - SafeAreaView: commonComponents.SafeAreaView, + get Alert() { return getFindContext(commonComponents.Alert)!.unproxy(); }, + get Button() { return getFindContext(commonComponents.Button)!.unproxy(); }, + get HelpMessage() { return getFindContext(commonComponents.HelpMessage)!.unproxy(); }, + get SafeAreaView() { return getFindContext(commonComponents.SafeAreaView)!.unproxy(); }, Summary: components.Summary, ErrorBoundary: components.ErrorBoundary, Codeblock: components.Codeblock,