diff --git a/index.js b/index.js index 401a6bac1bb9f9485119a4766a41c781147f3af3..5f5f76da4cf8cd4966feac8e75afbd26fcaf86c6 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. */