Przeglądaj źródła

postMessage fix

Tero Paananen 4 lat temu
rodzic
commit
2deafa9ae9

+ 1
- 1
windows/ReactNativeWebView/ReactWebViewManager.cpp Wyświetl plik

@@ -141,7 +141,7 @@ namespace winrt::ReactNativeWebView::implementation {
141 141
             else if (commandId == L"injectJavaScript") {
142 142
                 webView.InvokeScriptAsync(L"eval", { winrt::to_hstring(commandArgs[0].AsString()) });
143 143
             } else if(commandId == L"postMessage") {
144
-                if (auto reactWebView = content.try_as<ReactNativeWebView::ReactWebView>()) {
144
+                if (auto reactWebView = view.try_as<ReactNativeWebView::ReactWebView>()) {
145 145
                     reactWebView.PostMessage(winrt::to_hstring(commandArgs[0].AsString()));
146 146
                 }
147 147
             }