我可以使用react-native-webview渲染HTML孔页面吗?

时间:2019-04-05 12:33:41

标签: react-native google-pay react-native-webview

所以问题是:我可以使用react-native-webview从背面(html页面)渲染响应吗?

2 个答案:

答案 0 :(得分:1)

是的,您可以使用react-native-webview呈现整个html页面

答案 1 :(得分:1)

我认为该示例将为您提供帮助 在网路上

<script>
  window.postMessage("Sending data from Web");
</script>
在React Native中
import React, { Component } from 'react';
import { StyleSheet, Text, View } from 'react-native';
import { WebView } from 'react-native-webview';

export default class App extends Component {
  
    }

    render() {
        return (
          <WebView
             ref="webview"
             onMessage={this.onMessage}
          />
        );
    }

  onMessage(data) {
  
  alert(data);
}
}