fix(UIWebview): Deprecate UIWebView and add link to issue (#313)

* Update WebView.ios.js

* Update WebView.ios.js
This commit is contained in:
Thibault Malbranche 2019-02-04 18:58:48 +01:00 committed by GitHub
parent 0535c04c11
commit 4c8024047b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -41,7 +41,7 @@ import type {
} from './WebViewTypes';
const resolveAssetSource = Image.resolveAssetSource;
let didWarnAboutUIWebViewUsage = false;
// Imported from https://github.com/facebook/react-native/blob/master/Libraries/Components/ScrollView/processDecelerationRate.js
function processDecelerationRate(decelerationRate) {
if (decelerationRate === 'normal') {
@ -153,6 +153,13 @@ class WebView extends React.Component<WebViewSharedProps, State> {
webViewRef = React.createRef();
UNSAFE_componentWillMount() {
if (!this.props.useWebKit && !didWarnAboutUIWebViewUsage) {
didWarnAboutUIWebViewUsage = true;
console.warn(
'UIWebView is deprecated and will be removed soon, please use WKWebView (do not override useWebkit={true} prop),' +
' more infos here: https://github.com/react-native-community/react-native-webview/issues/312',
);
}
if (
this.props.useWebKit === true &&
this.props.scalesPageToFit !== undefined