[react_native] JS files from D1980312: [react_native] Fix webview
This commit is contained in:
parent
21f45e8899
commit
96e9ad9aec
|
@ -34,8 +34,8 @@ var WebViewState = keyMirror({
|
||||||
var WebView = React.createClass({
|
var WebView = React.createClass({
|
||||||
|
|
||||||
propTypes: {
|
propTypes: {
|
||||||
renderError: PropTypes.func.isRequired, // view to show if there's an error
|
renderError: PropTypes.func, // view to show if there's an error
|
||||||
renderLoading: PropTypes.func.isRequired, // loading indicator to show
|
renderLoading: PropTypes.func, // loading indicator to show
|
||||||
url: PropTypes.string.isRequired,
|
url: PropTypes.string.isRequired,
|
||||||
automaticallyAdjustContentInsets: PropTypes.bool,
|
automaticallyAdjustContentInsets: PropTypes.bool,
|
||||||
contentInset: EdgeInsetsPropType,
|
contentInset: EdgeInsetsPropType,
|
||||||
|
@ -66,10 +66,10 @@ var WebView = React.createClass({
|
||||||
var otherView = null;
|
var otherView = null;
|
||||||
|
|
||||||
if (this.state.viewState === WebViewState.LOADING) {
|
if (this.state.viewState === WebViewState.LOADING) {
|
||||||
otherView = this.props.renderLoading();
|
otherView = this.props.renderLoading && this.props.renderLoading();
|
||||||
} else if (this.state.viewState === WebViewState.ERROR) {
|
} else if (this.state.viewState === WebViewState.ERROR) {
|
||||||
var errorEvent = this.state.lastErrorEvent;
|
var errorEvent = this.state.lastErrorEvent;
|
||||||
otherView = this.props.renderError(
|
otherView = this.props.renderError && this.props.renderError(
|
||||||
errorEvent.domain,
|
errorEvent.domain,
|
||||||
errorEvent.code,
|
errorEvent.code,
|
||||||
errorEvent.description);
|
errorEvent.description);
|
||||||
|
|
Loading…
Reference in New Issue