[ReactNative] s/render*View/render/ in <WebView>

This commit is contained in:
Christopher Chedeau 2015-03-18 16:14:01 -07:00
parent afb71ae1c3
commit 4b42f8c9e9
3 changed files with 12 additions and 12 deletions

View File

@ -81,8 +81,8 @@ var WebViewExample = React.createClass({
automaticallyAdjustContentInsets={false} automaticallyAdjustContentInsets={false}
style={styles.webView} style={styles.webView}
url={this.state.url} url={this.state.url}
renderErrorView={this.renderErrorView} renderError={this.renderError}
renderLoadingView={this.renderLoadingView} renderLoading={this.renderLoading}
onNavigationStateChange={this.onNavigationStateChange} onNavigationStateChange={this.onNavigationStateChange}
startInLoadingState={true} startInLoadingState={true}
/> />
@ -115,7 +115,7 @@ var WebViewExample = React.createClass({
}); });
}, },
renderErrorView: function(errorDomain, errorCode, errorDesc) { renderError: function(errorDomain, errorCode, errorDesc) {
return ( return (
<View style={styles.errorContainer}> <View style={styles.errorContainer}>
<Text style={styles.errorTextTitle}> <Text style={styles.errorTextTitle}>
@ -134,7 +134,7 @@ var WebViewExample = React.createClass({
); );
}, },
renderLoadingView: function() { renderLoading: function() {
return ( return (
<View style={styles.loadingView}> <View style={styles.loadingView}>
<ActivityIndicatorIOS /> <ActivityIndicatorIOS />

View File

@ -29,8 +29,8 @@ var WebViewState = keyMirror({
var WebView = React.createClass({ var WebView = React.createClass({
propTypes: { propTypes: {
renderErrorView: PropTypes.func.isRequired, // view to show if there's an error renderError: PropTypes.func.isRequired, // view to show if there's an error
renderLoadingView: PropTypes.func.isRequired, // loading indicator to show renderLoading: PropTypes.func.isRequired, // loading indicator to show
url: PropTypes.string.isRequired, url: PropTypes.string.isRequired,
automaticallyAdjustContentInsets: PropTypes.bool, automaticallyAdjustContentInsets: PropTypes.bool,
contentInset: EdgeInsetsPropType, contentInset: EdgeInsetsPropType,
@ -61,10 +61,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.renderLoadingView(); otherView = 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.renderErrorView( otherView = this.props.renderError(
errorEvent.domain, errorEvent.domain,
errorEvent.code, errorEvent.code,
errorEvent.description); errorEvent.description);

View File

@ -42,8 +42,8 @@ var WebView = React.createClass({
}, },
propTypes: { propTypes: {
renderErrorView: PropTypes.func.isRequired, // view to show if there's an error renderError: PropTypes.func.isRequired, // view to show if there's an error
renderLoadingView: PropTypes.func.isRequired, // loading indicator to show renderLoading: PropTypes.func.isRequired, // loading indicator to show
url: PropTypes.string.isRequired, url: PropTypes.string.isRequired,
automaticallyAdjustContentInsets: PropTypes.bool, automaticallyAdjustContentInsets: PropTypes.bool,
shouldInjectAJAXHandler: PropTypes.bool, shouldInjectAJAXHandler: PropTypes.bool,
@ -71,10 +71,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.renderLoadingView(); otherView = 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.renderErrorView( otherView = this.props.renderError(
errorEvent.domain, errorEvent.domain,
errorEvent.code, errorEvent.code,
errorEvent.description); errorEvent.description);