我的项目中有以下RN代码。我想导航到我发表评论的屏幕。我在一个Web视图中,如果条件为true,我想导航到特定屏幕。我有什么办法可以做到这一点?
const int num = 2;
int arr[num];
arr[0] = 123;
arr[1] = 456;
vector<int*> inner;
vector<int**> outer;
inner.reserve(num);
outer.reserve(num);
for(int i = 0; i < num; ++i)
{
inner.push_back(&arr[i]);
outer.push_back(&inner[i]);
}
cout << "before:";
for (int i : arr) {
cout << i << " ";
}
cout << endl;
for(int i = 0; i < num; ++i) {
**(outer[i]) *= 2;
}
cout << "after:";
for (int i : arr) {
cout << i << " ";
}
cout << endl;
答案 0 :(得分:1)
class CitizenLoginWebView extends Component {
render() {
return (
<WebView
ref={'webview'}
source={{uri: citizenLoginUrl}}
onNavigationStateChange={navState => {
if (navState.title === "Consent Platform") {
if (hasWordsInString(navState.url, searchWords)) {
this.refs.webview.stopLoading();
this.props.navigation.navigate(screen);
console.log('Words found');
}
}
}}
/>
);
}
}
如果您使用React-Navigation,这将起作用