infinitered / ignite-bowser

Bowser is now re-integrated into Ignite CLI! Head to https://github.com/infinitered/ignite to check it out.
https://infinite.red/ignite
MIT License
615 stars 140 forks source link

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

Open AleeeKoi opened 3 years ago

AleeeKoi commented 3 years ago

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