- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用 react-native-webview
来呈现 webview。当我在 webview 中从一个页面导航到另一个页面,然后尝试使用 this.webviewref.goBack()
返回时,我得到了 nodeHandle expected to be non-null
.
这是我的代码
<View style={{ flex: 1 }}>
<Header
headingText={headerText}
onpress={() => {
// this.dispatchCustomEvent(BACK_PRESS);
if (this.canGoBack) {
this.webViewRef.goBack();
} else NavigationActions.pop();
}}
/>
<WebView
source={{ uri: "http://localhost:3001/invite/" }}
bounces={false}
javaScriptEnabled={true}
ref={webViewRef => (this.webViewRef = webViewRef)}
// injectedJavaScript={patchPostMessageJsCode}
onMessage={event => {
const { type, data } = JSON.parse(event.nativeEvent.data);
console.log({ type });
console.log({ data });
this.handleEvent(type, data);
}}
onNavigationStateChange={navState =>
(this.canGoBack = navState.canGoBack)
}
/>
</View>
控制台日志记录 this.webViewRef
显示 weViewRef 中存在 goBack
方法
抛出 nodeHandle expected to be non-null
的代码可以在这里找到 https://github.com/react-native-community/react-native-webview/blob/master/src/WebView.ios.tsx
我无法理解 getWebViewHandle
有什么问题以及为什么 nodeHandle
为 null。
最佳答案
我遇到了同样的问题。原来是我的react-native版本太低了。它至少需要 0.57。升级到0.59.5及其他依赖后,该问题消失。
关于ios - React-Native-Webview:预期 nodeHandle 不为空,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55535654/
我正在使用 react-native-webview 来呈现 webview。当我在 webview 中从一个页面导航到另一个页面,然后尝试使用 this.webviewref.goBack() 返回
我希望能够通过 lambda 定义回调,但我无法获得任何匹配的函数签名。 std::function callback = [&mycapture](const sensor_msgs::Point
我是一名优秀的程序员,十分优秀!