Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d40e98d

Browse files
committed
fix(iframe-plugin): the iframe is painted as a blank view
fix native-html#41
1 parent af92bf0 commit d40e98d

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

packages/iframe-plugin/src/HTMLIframe.tsx

+8-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
LinkPressTarget,
77
useWebshell
88
} from '@formidable-webview/webshell';
9-
import { StyleProp, ViewStyle } from 'react-native';
9+
import { StyleProp, View, ViewStyle } from 'react-native';
1010
import { RenderersProps } from 'react-native-render-html';
1111
import { linkPressTargetToOnDOMLinkPressArgs } from '@native-html/plugins-core';
1212

@@ -148,10 +148,15 @@ export default function HTMLIframe({
148148
props: {
149149
...userWebViewProps,
150150
onDOMLinkPress,
151-
style,
152151
source,
153152
testID: 'iframe'
154153
}
155154
});
156-
return React.createElement(WebView, webViewProps);
155+
// We need to wrap the WebView in a View to circumvent a bug in
156+
// react-native-webview, see https://git.io/JKY1r
157+
return (
158+
<View style={style}>
159+
<WebView {...webViewProps} />
160+
</View>
161+
);
157162
}

0 commit comments

Comments
 (0)