From 0fd85f38b5493c4bb202ca97af395aa5368f3ba4 Mon Sep 17 00:00:00 2001 From: PalmDevs Date: Wed, 11 Dec 2024 20:46:32 +0700 Subject: [PATCH] fix(app): add iOS crash fix back --- libraries/app/src/index.tsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libraries/app/src/index.tsx b/libraries/app/src/index.tsx index 91fb934..68cdec9 100644 --- a/libraries/app/src/index.tsx +++ b/libraries/app/src/index.tsx @@ -3,6 +3,7 @@ import { React, ReactNative } from '@revenge-mod/modules/common' import { findByName } from '@revenge-mod/modules/finders' import { BundleUpdaterManager } from '@revenge-mod/modules/native' import { createPatcherInstance } from '@revenge-mod/patcher' +import { ReactJSXLibrary } from '@revenge-mod/react/jsx' import { createLogger } from '@revenge-mod/utils/library' import type { Component, FC, ReactNode } from 'react' @@ -68,6 +69,12 @@ const unpatchCreateElement = patcher.after( const afterErrorBoundaryPatchable = ReactNative.Platform.OS === 'ios' ? afterAppRender : afterAppInitialize afterErrorBoundaryPatchable(async function patchErrorBoundary() { + // Patching ErrorBoundary causes the weird "Element type is invalid" error due to TextInputWrapper's children being undefined + // The reason for it being undefined is unknown, but it's not a problem on Android + // Using this patch on Android also breaks how the chat input bar avoids the keyboard + if (ReactNative.Platform.OS === 'ios') + ReactJSXLibrary.afterElementCreate('PortalKeyboardPlaceholderInner', () => null) + const { default: Screen } = await import('./components/ErrorBoundaryScreen') setImmediate(() => {