Skip to content

v5.0.0

Compare
Choose a tag to compare
@Titozzz Titozzz released this 01 Feb 17:39
· 754 commits to master since this release

5.0.0 (2019-02-01)

Features

BREAKING CHANGES

  • Android/iOS postMessage:

Communication from webview to react-native has been completely rewritten. React-native-webview will not use or override window.postMessage anymore. Reasons behind these changes can be found throughout so many issues that it made sense to go that way.

window.postMessage(data, *) has been changed to
window.ReactNativeWebView.postMessage(data)

Side note: if you wish to keep compatibility with the old version when you upgrade, you can use the injectedJavascript prop to do that:

const injectedJavascript = `(function() {
  window.postMessage = function(data) {
    window.ReactNativeWebView.postMessage(data);
  };
})()`;

Huge thanks to @jordansexton and @KoenLav!