[Android][JS]: supports prop "html" in WebView

This commit is contained in:
Hedger Wang 2015-07-10 12:21:19 -07:00
parent b54594e42b
commit 2cbcfcea88

View File

@ -36,7 +36,8 @@ var WebView = React.createClass({
propTypes: { propTypes: {
renderError: PropTypes.func, // view to show if there's an error renderError: PropTypes.func, // view to show if there's an error
renderLoading: PropTypes.func, // loading indicator to show renderLoading: PropTypes.func, // loading indicator to show
url: PropTypes.string.isRequired, url: PropTypes.string,
html: PropTypes.string,
automaticallyAdjustContentInsets: PropTypes.bool, automaticallyAdjustContentInsets: PropTypes.bool,
contentInset: EdgeInsetsPropType, contentInset: EdgeInsetsPropType,
onNavigationStateChange: PropTypes.func, onNavigationStateChange: PropTypes.func,
@ -102,6 +103,7 @@ var WebView = React.createClass({
key="webViewKey" key="webViewKey"
style={webViewStyles} style={webViewStyles}
url={this.props.url} url={this.props.url}
html={this.props.html}
injectedJavaScript={this.props.injectedJavaScript} injectedJavaScript={this.props.injectedJavaScript}
userAgent={this.props.userAgent} userAgent={this.props.userAgent}
javaScriptEnabledAndroid={this.props.javaScriptEnabledAndroid} javaScriptEnabledAndroid={this.props.javaScriptEnabledAndroid}
@ -183,6 +185,7 @@ var WebView = React.createClass({
var RCTWebView = createReactNativeComponentClass({ var RCTWebView = createReactNativeComponentClass({
validAttributes: merge(ReactNativeViewAttributes.UIView, { validAttributes: merge(ReactNativeViewAttributes.UIView, {
html: true,
injectedJavaScript: true, injectedJavaScript: true,
javaScriptEnabledAndroid: true, javaScriptEnabledAndroid: true,
url: true, url: true,