最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - React native - navigation.navigate is not a function - Stack Overflow

programmeradmin2浏览0评论

I got this yellow warning message when trying to navigate the through pages.

navigation.navigate is not a function

My code

export default (navigation) => (
  <View>
    <Card>
      <Button
        onPress={() => {
          onSignIn().then(() => navigation.navigate("SignedIn")); //yellow warning message
        }}
      />
    </Card>
  </View>
);

This solution not really helping - navigation.navigate is not a function.

Reference:

I got this yellow warning message when trying to navigate the through pages.

navigation.navigate is not a function

My code

export default (navigation) => (
  <View>
    <Card>
      <Button
        onPress={() => {
          onSignIn().then(() => navigation.navigate("SignedIn")); //yellow warning message
        }}
      />
    </Card>
  </View>
);

This solution not really helping - navigation.navigate is not a function.

Reference: https://github./datomnurdin/auth-reactnative

Share Improve this question edited Dec 24, 2018 at 23:54 halfer 20.4k19 gold badges109 silver badges202 bronze badges asked Dec 24, 2018 at 10:24 NurdinNurdin 23.9k47 gold badges140 silver badges315 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 6

Have you tried to add curly braces around the navigation

export default ({navigation}) => (
  <View>
    <Card>
      <Button
        onPress={() => {
          onSignIn().then(() => navigation.navigate("SignedIn")); //yellow warning message
        }}
      />
    </Card>
  </View>
);
发布评论

评论列表(0)

  1. 暂无评论