state = {
title: []
}
render() {
return (<NavigationContainer>
<Stack.Navigator>
<Stack.Screen
name="Dashboard"
component={Dashboard}
initialParams={{title:this.state.title}}
/>
</Stack.Navigator>
</NavigationContainer>}
export default class Dashboard extends React.Component {
constructor(prop) {
super(prop);
console.log( this.props.route.params)
this.state = {
search:"",
templist:this.props.route.params.title,
title: this.props.route.params.title}
**我想将标题(Array)传递给Screen 但是我没有在屏幕上显示数组**
答案 0 :(得分:0)
偶然发现了类似的问题。通过对我试图传递的数组进行字符串化使其工作
{title: JSON.stringify(this.state.title)}