mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-24 04:16:00 +08:00
Fix scalesPageToFit default property for iOS WebView.
Summary: `scalesPageToFit`'s [documented default value is true](https://github.com/facebook/react-native/blob/master/Libraries/Components/WebView/WebView.ios.js#L318), but it's not explicitly set anywhere on iOS. On Android it's [set to true in defaultProps](https://github.com/facebook/react-native/blob/master/Libraries/Components/WebView/WebView.android.js#L203). This pull-request add the default behaviour. ``` import { WebView } from 'react-native; /* ... */ <WebView source={{ uri: 'https://google.com' }} /> ``` You should be able to zoom in and out using the pinch gesture. 1. Does the reviewer have any additional thoughts around the rest of the defaultProps which aren't explicitly set? 2. Does the reviewer have any additional thoughts on how these two components (iOS/ Android) can share more code? Closes https://github.com/facebook/react-native/pull/14363 Differential Revision: D5345883 Pulled By: shergin fbshipit-source-id: e7b9b89f13d6adcdc705244871e00b7a5da52c64
This commit is contained in:
committed by
Facebook Github Bot
parent
16747dd807
commit
185948604c
@@ -367,6 +367,10 @@ class WebView extends React.Component {
|
||||
]),
|
||||
};
|
||||
|
||||
static defaultProps = {
|
||||
scalesPageToFit: true,
|
||||
};
|
||||
|
||||
state = {
|
||||
viewState: WebViewState.IDLE,
|
||||
lastErrorEvent: (null: ?ErrorEvent),
|
||||
|
||||
Reference in New Issue
Block a user