Skip to content
This repository has been archived by the owner on Jan 13, 2023. It is now read-only.

react-native-viewpager - Couldn't find a navigation context #374

Open
AleeeKoi opened this issue Sep 8, 2020 · 0 comments
Open

react-native-viewpager - Couldn't find a navigation context #374

AleeeKoi opened this issue Sep 8, 2020 · 0 comments

Comments

@AleeeKoi
Copy link

AleeeKoi commented Sep 8, 2020

Hello!
I'm trying to integrate this lib react-native-viewpager
If I create a reference in my functional component like this:

const viewPageRef = React.useRef()

an passing to the ViewPage component:

<ViewPager ref={viewPageRef} style={styles.viewPager} initialPage={0} >
  {pages.map((Comp, i) => (<Comp key={`main-page-view-${i}`} />))}
</ViewPager>

I got the following error:

Couldn't find a navigation context. Have you wrapped your app with 'NavigationContainer'? See https://reactnavigation.org/docs/getting-started for setup instructions.

and yes, my app is wrapped in NavigationContainer (v5).

I'm forgetting something?

Thank you

@AleeeKoi AleeeKoi changed the title Couldn't find a navigation context react-native-viewpager - Couldn't find a navigation context Sep 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant