From 46f2938fb337047858a29931f99f67298690e374 Mon Sep 17 00:00:00 2001 From: "jian.sun1" Date: Sun, 21 Aug 2022 21:51:18 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=A1=B5=E9=9D=A2=E4=B8=BA=E5=87=BD?= =?UTF-8?q?=E6=95=B0=E5=BC=8F=E7=BB=84=E4=BB=B6=E6=97=B6=E4=B8=8D=E5=86=8D?= =?UTF-8?q?=E9=A2=9D=E5=A4=96=E5=8C=85=E8=A3=B9=20View=20#12305?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. fix #12305 2. 透传 ref, 方便函数式组件配置回调 (如: componentDidShow) --- packages/taro-runtime-rn/src/page.ts | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/packages/taro-runtime-rn/src/page.ts b/packages/taro-runtime-rn/src/page.ts index 61d407440125..4649dd20529e 100644 --- a/packages/taro-runtime-rn/src/page.ts +++ b/packages/taro-runtime-rn/src/page.ts @@ -1,6 +1,6 @@ import { getCurrentRoute, PageProvider } from '@tarojs/router-rn' import * as React from 'react' -import { AppState, Dimensions, EmitterSubscription, NativeEventSubscription, RefreshControl, ScrollView, View } from 'react-native' +import { AppState, Dimensions, EmitterSubscription, NativeEventSubscription, RefreshControl, ScrollView } from 'react-native' import { isClassComponent } from './app' import { Current } from './current' @@ -112,12 +112,7 @@ export function createPageConfig (Page: any, pageConfig: PageConfig): any { ScreenPage = React.forwardRef((props, ref) => { const newProps: React.Props = { ...props } newProps.ref = ref - return h(View, { - style: { - minHeight: '100%' - }, - ...newProps - }, h(Page, { ...props }, null)) + return h(Page, { ...newProps }, null) }) }