Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What is actually this 'navigation' variable in DetailsHeader in Details.js #2

Open
deep-woods opened this issue Jun 10, 2022 · 0 comments

Comments

@deep-woods
Copy link

deep-woods commented Jun 10, 2022

Hi.
I'm curious about the navigation variable we can pass in to the DetailsHeader.
So in order to navigate back to the previous page, we press the CircleButton which brings us back to the previous page via onPress function (which is defined as handlePress={() => navigation.goBack() under the hood.)

But then I'm curious about what is actually the thing that we are passing in to the DetailsHeader in the place of the navigation variable. Is it like the entire "previous page" information or ?
I tried to figure out what it is but its definition is nowhere to be found across the whole project.

Can someone explain it please...?

Code link: https://github.com/adrianhajdin/react-native-nft-marketplace/blob/main/screens/Details.js
Code in question

const DetailsHeader = ({ data, navigation 👈 }) => (       <----------   ❓❓❓
  <View style={{ width: "100%", height: 373 }}>
    <Image
      source={data.image}
      resizeMode="cover"
      style={{ width: "100%", height: "100%" }}
    />

    <CircleButton
      imgUrl={assets.left}
      handlePress={() => navigation.goBack() 👈 }               <----------   ❓❓❓
      left={15}
      top={StatusBar.currentHeight + 10}
    />

    <CircleButton
      imgUrl={assets.heart}
      right={15}
      top={StatusBar.currentHeight + 10}
    />
  </View>
);
@deep-woods deep-woods changed the title ' What is actually this 'navigation' variable in DetailsHeader in Details.js Jun 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant