最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - React native navigation error with .replace() and .reset() - Stack Overflow

programmeradmin4浏览0评论
<TouchableOpacity
style={styles.button}
onPress={() => {
navigation.reset({
index: 0,
routes: [{ name: 'ProfilePage' }],
});
}}
>
<Text style={styles.buttonText}>Test Navigation</Text>
</TouchableOpacity>

This code crashes my app whenever I click on the Test Navigation button. I've read on multiple posts on reddit, github and stackexchange that the fix is to install react-native-reanimated, and to add

import react-native-reanimated;

to the top of the App.js file. I did both those things and it doesn't work. I've got no clue what to do

发布评论

评论列表(0)

  1. 暂无评论