Webview不加载poupup - ReactNative
问题描述:
在反应原生webview不加载任何弹出窗口。当我尝试显示弹出窗口时,还有_onShouldStartLoadWithRequest
,_onNavigationStateChange
,_renderError
没有记录任何事件。Webview不加载poupup - ReactNative
下面是我的渲染方法。
render() {
const finalURL='xyz';
return(
<WebView
source={{uri:finalURL}}
javaScriptEnabled={true}
domStorageEnabled={true}
onLayout={this._onLayout}
onShouldStartLoadWithRequest={this._onShouldStartLoadWithRequest}
onNavigationStateChange={this._onNavigationStateChange}
startInLoadingState={true}
renderError={this._renderError}
/>
);
}
任何有关如何显示木偶的建议。
答
按阵营本地文件上的WebView组件 https://facebook.github.io/react-native/docs/webview.html#onshouldstartloadwithrequest
onShouldStartLoadWithRequest道具只适用于iOS和它应该返回一个true或false值要么继续加载请求或停止加载。
_onShouldStartLoadWithRequest() {
return true
}