javascript - 反应导航5路线未定义
问题描述
我正在尝试将一些参数发送到其他屏幕,但是当我控制台props.route
它显示未定义时。我真的很努力,但无法解决这个问题。有人可以帮我解决这个问题。
谢谢 。
组件 1
<MaterialIcons
name="edit"
size={22}
color="#646564"
style={{ paddingRight: 7 }}
onPress={() =>
navigation.navigate("EducationForm", {
editing: true,
id: item.id,
})
}
/>
组件 2
const 2ndComponent = ({ navigation, route }) => {
console.log('@@@@ route',route) ; // it returns undefined
}