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

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

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>
);

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745600455a4635368.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信