Skip to content

Commit

Permalink
feat: add postMessage method to send message to react native webview
Browse files Browse the repository at this point in the history
  • Loading branch information
dagmawig committed Feb 9, 2024
1 parent dfe5b65 commit 4f5f40c
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/components/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,7 @@ function MapComponent() {

async function handleClickTree(tree) {
log.warn('click tree:', tree);
if (window.parent) {
log.warn('DEMO:ok message parent');
window.parent.postMessage(JSON.stringify(tree), '*');
}
window.ReactNativeWebView?.postMessage(JSON.stringify(tree));

const wholeTree = await getTreeById(tree.id).catch((err) => log.warn(err));
const result = pathResolver.getPathWhenClickTree(
Expand Down

0 comments on commit 4f5f40c

Please sign in to comment.