找不到要导航的对象

时间:2018-10-17 23:24:12

标签: javascript react-native

class ProfileV extends React.Component {

  onPressSearch = term => {
    console.log(term);
  }

  homePage = () => {
    this.props.navigation.navigate('Profile');
  }

render(){
    return (
      <Container style={styles.MainContainer}>
          <SearchHeader
            home={this.homePage}
            />
          <Content style = {styles.content}>
            <Title style = {styles.text}> TRENDING </Title>
          </Content>
      </Container>
    );
  }
}

export default ProfileV;

错误:{

-undefined不是对象(正在评估'_this.props.navigation.navigate')

-主页 ProfileV.js:33:26

}

我该如何解决?

0 个答案:

没有答案