1

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.com/datomnurdin/auth-reactnative

halfer
  • 19,824
  • 17
  • 99
  • 186
Nurdin
  • 23,382
  • 43
  • 130
  • 308

1 Answers1

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>
);
Roi
  • 983
  • 9
  • 17
  • 1
    Yeah. Understandable. If this solved your problem, could you then accept my answer please? :) – Roi Dec 24 '18 at 10:32