mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
3945f10561
Summary: Changes RNTester, first attempt in the direction of improving the RNTester overall. Related ticket: #24647 Changed the `js` directory of the RNTester to have the following structure: ``` - js - assets - components - examples - types - utils ``` * **assets** _Any images, gifs, and media content_ * **components** _All shared components_ * **examples** _Example View/Components to be rendered by the App_ * **types** _Shared flow types_ * **utils** _Shared utilities_ ## Changelog [General] [Changed] - Update folder structure of RNTester's JS directory. Pull Request resolved: https://github.com/facebook/react-native/pull/25013 Differential Revision: D15515773 Pulled By: cpojer fbshipit-source-id: 0e4b6386127f338dca0ffe8c237073be53a9e221
29 lines
919 B
HTML
29 lines
919 B
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title>Messaging Test</title>
|
|
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
|
<meta name="viewport" content="width=320, user-scalable=no">
|
|
</head>
|
|
<body>
|
|
<p>Messages received from React Native: 0</p>
|
|
<p>(No messages)</p>
|
|
<button type="button">
|
|
Send message to React Native
|
|
</button>
|
|
</body>
|
|
<script>
|
|
var messagesReceivedFromReactNative = 0;
|
|
document.addEventListener('message', function(e) {
|
|
messagesReceivedFromReactNative += 1;
|
|
document.getElementsByTagName('p')[0].innerHTML =
|
|
'Messages received from React Native: ' + messagesReceivedFromReactNative;
|
|
document.getElementsByTagName('p')[1].innerHTML = e.data;
|
|
});
|
|
|
|
document.getElementsByTagName('button')[0].addEventListener('click', function() {
|
|
window.postMessage('"Hello" from the web view');
|
|
});
|
|
</script>
|
|
</html>
|