'use strict';
var React = require('react');
var ReactNative = require('react-native');
var {AppRegistry, Text, WebView, View, Dimensions} = ReactNative;
var WebViewResizing = React.createClass({
getInitialState: function () {
return {
webViewHeight: 100 // default height, can be anything
};
},
render: function () {
var html = '
WebView Content
- Foo
- Bar
- Baz
<\/ul>';
return (
This is above the WebView.
This is below the WebView.
);
},
//called when HTML was loaded and injected JS executed
_updateWebViewHeight: function (event) {
//jsEvaluationValue contains result of injected JS
this.setState({webViewHeight: parseInt(event.jsEvaluationValue)});
}
});
AppRegistry.registerComponent('WebViewResizing', () => WebViewResizing);