/**
* Sample React Native App
* https://github.com/facebook/react-native
*/
'use strict';
var React = require('react-native');
var WebViewBridge = require('react-native-webview-bridge');
var {
AppRegistry,
StyleSheet,
Text,
View
} = React;
var htmlContent = `
Test Content
Hello this is a temp page;
`;
var WebViewBridgeExample = React.createClass({
componentDidMount: function () {
this.refs.myWebView.onMessage((message) => {
console.log('got a message from webview:', message);
setTimeout(() => {
this.refs.myWebView.send("You got it.")
}, 1000);
});
},
render: function() {
return (
);
}
});
var styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
},
welcome: {
fontSize: 20,
textAlign: 'center',
margin: 10,
},
instructions: {
textAlign: 'center',
color: '#333333',
marginBottom: 5,
},
});
AppRegistry.registerComponent('WebViewBridgeExample', () => WebViewBridgeExample);