undefined不是一个对象(评估“route. params”)是错误代码,但我不知道如何修复它...
Screen1:
function Screen1({ navigation }) {
return (
between return and onPress are some components
onPress={() =>
navigation.navigate("Screen2", {
title: "Beispiel Titel",
author: "Beispiel Author",
genre: "Beispiel Genre",
})
画面二:
function BookDetailScreen({ route, navigation }) {
const { title, author, genre } = route.params;
有人能帮忙吗?谢谢!:)
我想将参数从屏幕1提供给屏幕2
1条答案
按热度按时间j0pj023g1#
有时react-navigation在第一次渲染时没有填充
route
对象。或者