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

Invariant Violation: requireNativeComponent: "LEGACY_RNCViewPager" was not found in the UIManager. #11999

Open
2 of 11 tasks
JmarshTri opened this issue May 21, 2024 · 17 comments
Open
2 of 11 tasks

Comments

@JmarshTri
Copy link

Current behavior

I've tried anything from RN 73, Reanimated 2 and 3

import * as React from 'react'
import { View, useWindowDimensions } from 'react-native'
import { TabView, SceneMap } from 'react-native-tab-view'

const FirstRoute = () => (
<View style={{ flex: 1, backgroundColor: '#ff4081' }} />
)

const SecondRoute = () => (
<View style={{ flex: 1, backgroundColor: '#673ab7' }} />
)

const renderScene = SceneMap({
first: FirstRoute,
second: SecondRoute,
})

export default function TabViewExample() {
const layout = useWindowDimensions()

const [index, setIndex] = React.useState(0)
const [routes] = React.useState([
{ key: 'first', title: 'First' },
{ key: 'second', title: 'Second' },
])

return (
<TabView
navigationState={{ index, routes }}
renderScene={renderScene}
onIndexChange={setIndex}
initialLayout={{ width: layout.width }}
/>
)
}

Expected behavior

Render the tab view without crashing

Reproduction

Can't produce

Platform

  • Android
  • iOS
  • Web
  • Windows
  • MacOS

Packages

  • @react-navigation/bottom-tabs
  • @react-navigation/drawer
  • @react-navigation/material-top-tabs
  • @react-navigation/stack
  • @react-navigation/native-stack
  • react-native-tab-view

Environment

  • [] I've removed the packages that I don't use
package version
"@react-navigation/bottom-tabs": "^6.5.20",
"@react-navigation/native": "^6.1.17",
"@react-navigation/stack": "^6.3.29",
"react-native-safe-area-context": "4.10.1",
"react-native-screens": "^3.31.1",
"react-native-gesture-handler": "^2.14.0",
"react-native-reanimated": "^3.11.0",
"react-native-tab-view": "3.5.2",
"react-native-pager-view": "^6.3.1",
"react-native": "0.74.1",
"yarn": "^1.22.4"
Copy link

Hey @JmarshTri! Thanks for opening the issue. It seems that the issue doesn't contain a link to a repro.

The best way to get attention to your issue is to provide an easy way for a developer to reproduce the issue.

You can provide a repro using any of the following:

A snack link is preferred since it's the easiest way to both create and share a repro. If it's not possible to create a repro using a snack, link to a GitHub repo under your username is a good alternative. Don't link to a branch or specific file etc. as it won't be detected.

Try to keep the repro as small as possible by narrowing down the minimal amount of code needed to reproduce the issue. Don't link to your entire project or a project containing code unrelated to the issue. See "How to create a Minimal, Reproducible Example" for more information.

You can edit your original issue to include a link to the repro, or leave it as a comment. The issue will be closed automatically after a while if you don't provide a repro.

@arslan-Techno
Copy link

@JmarshTri did you find any solution ??

@kaaaaaaaaaaai
Copy link

same problems

@arslan-Techno
Copy link

npm i react-native-pager-view and cd ios && pod install worked for me

@rodrigoAbril
Copy link

installing it thru expo fixed it for me
npx expo install react-native-pager-view

@JmarshTri
Copy link
Author

I added react-native-pager-view via yarn and that does not work. I've also ran "rm -rf node_modules; rm -rf ios/build; rm -rf ios/Pods; rm -rf ios/Podfile.lock; yarn; yarn pods" after installing pager-view still getting the error.

I also tried npx expo install react-native-pager-view no success with that either

@kaaaaaaaaaaai
Copy link

i tried, me too

@SwanHub
Copy link

SwanHub commented May 30, 2024

installing it thru expo fixed it for me npx expo install react-native-pager-view

worked for me

@jilvanx
Copy link

jilvanx commented Jun 3, 2024

If you are using expo run: npx expo run:ios or npx expo run:android, after installing npx expo install react-native-pager-view
Worked for me

@JmarshTri
Copy link
Author

I'm not using expo and have yet to find a solution that works

@dowatugkins
Copy link

dowatugkins commented Jun 14, 2024

@JmarshTri, did you ever get it figured out? I was having problems after installing it and running pod install so I ran all my blowout everything and rebuild commands and it did the trick for me. I ran my first aliased command rm -rf node_modules/; rm package-lock.json; rm yarn.lock; cd ios; rm -rf Pods/; rm Podfile.lock; rm -rf build/; cd ..; yarn install; cd ios; bundle exec pod repo update; bundle exec pod install; cd .. and then my second aliased command bundle install; cd ios; bundle exec pod repo update; bundle exec pod install; cd .. followed by my reset cache command yarn start --reset-cache followed by my simulator run command yarn ios --simulator 'iPhone 15 Pro Max (iOS 17.4)' and it finally worked. Hopefully you've gotten it figured out by now though.

I also put in a PR to add the need for pod install to the docs when using react-native-tab-view without being tied to react navigation.

@viquanghoa
Copy link

after installing npx expo install react-native-pager-view
worked for me.
Remember that stop simulator then restart, it will work.

@franfernandez20
Copy link

npx expo install react-native-pager-view

That fix the problem for me 👌

@pratiksham28
Copy link

pratiksham28 commented Jul 30, 2024

Not working for React-native cli on ios device-
"react": "18.2.0",
"react-native": "0.74.2",
"react-native-pager-view": "^6.3.3",
"react-native-tab-view": "^3.5.2",
"@react-navigation/bottom-tabs": "^6.5.20",
"@react-navigation/material-top-tabs": "^6.6.14",
"@react-navigation/native": "^6.1.17",
"@react-navigation/native-stack": "^6.9.26",
"@react-navigation/stack": "^6.4.0",

@bachvinh
Copy link

installing it thru expo fixed it for me npx expo install react-native-pager-view

Worked for me

@RutvinBhanderi
Copy link

RutvinBhanderi commented Aug 27, 2024

Not working for React-native cli on ios device- "react": "18.2.0", "react-native": "0.74.2", "react-native-pager-view": "^6.3.3", "react-native-tab-view": "^3.5.2", "@react-navigation/bottom-tabs": "^6.5.20", "@react-navigation/material-top-tabs": "^6.6.14", "@react-navigation/native": "^6.1.17", "@react-navigation/native-stack": "^6.9.26", "@react-navigation/stack": "^6.4.0",

install @6.3.1 version and run this cd ios, pod install

@parampreetsingh217
Copy link

installing it thru expo fixed it for me npx expo install react-native-pager-view

worked for me as well maybe try deleting the prev pack and installing this one if it doesnt work the first time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests