From 8af36fed136b0459f309a0ee19bc6398d9485b17 Mon Sep 17 00:00:00 2001 From: tianyili Date: Tue, 9 May 2023 10:47:57 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20[RN=E5=8D=87=E7=BA=A7]=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0webview=E5=85=A5=E5=8F=A3=E5=85=BC=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.js | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/index.js b/index.js index 401a6bac1b..5f5f76da4c 100644 --- a/index.js +++ b/index.js @@ -447,6 +447,14 @@ module.exports = { get RootTagContext(): RootTagContext { return require('./Libraries/ReactNative/RootTag').RootTagContext; }, + get WebView(): any { + console.warn( + 'WebView has been removed from React Native. ' + + "It can now be installed and imported from 'react-native-webview' instead of 'react-native'. " + + 'See https://github.com/react-native-webview/react-native-webview', + ); + return require('react-native-webview').default + }, get unstable_enableLogBox(): () => void { return () => console.warn( @@ -538,17 +546,17 @@ if (__DEV__) { * attempting to access WebView. */ /* $FlowFixMe[invalid-export] This is intentional: Flow will error when * attempting to access WebView. */ - Object.defineProperty(module.exports, 'WebView', { - configurable: true, - get() { - invariant( - false, - 'WebView has been removed from React Native. ' + - "It can now be installed and imported from 'react-native-webview' instead of 'react-native'. " + - 'See https://github.com/react-native-webview/react-native-webview', - ); - }, - }); + // Object.defineProperty(module.exports, 'WebView', { + // configurable: true, + // get() { + // invariant( + // false, + // 'WebView has been removed from React Native. ' + + // "It can now be installed and imported from 'react-native-webview' instead of 'react-native'. " + + // 'See https://github.com/react-native-webview/react-native-webview', + // ); + // }, + // }); /* $FlowFixMe[prop-missing] This is intentional: Flow will error when * attempting to access NetInfo. */ -- Gitee