未定义不是对象(评估'_this.props.navigation.state.params.datas.map)

时间:2019-03-04 16:36:52

标签: react-native

我将数据从page2组件发送到page1组件:

  

this.props.navigation.navigate('Page1',{datas:alldata});

     

我像这样在page1中获取数据:

  constructor(props) {
                super(props);

                this.props.navigation.state.params.datas.map(color => {
                    if(color.Renk == 'MAVI'){
                        console.log("mavi");
                        Blue.push("MAVI");
                    }
                    else if(color.Renk == 'SARI')
                    {
                        Yellow.push("SARI")
                    }
                })
              }

在调试模式下一切正常。我可以接受所有数据。但是启用调试模式后,它会提示我该错误

0 个答案:

没有答案