React-native-tab-view: npm issue ('react-native-tab-view'), not able to import { tabBar } from react-native-tab-view

Created on 2 Jan 2020  Â·  6Comments  Â·  Source: satya164/react-native-tab-view

Current behaviour

Expected behaviour

Code sample

For Syntax Highlighting check this link

Screenshots (if applicable)

What have you tried

Your Environment

| software | version
| ---------------------------- | -------
| ios or android |
| react-native |
| react-native-tab-view |
| react-native-gesture-handler |
| react-native-reanimated |
| node |
| npm or yarn |

bug no-issue-activity

Most helpful comment

I arrived here because this error was being thrown in "react-navigation-tabs", it is worth noting that if you are using yarn you can create a version resolution to work around this:

"resolutions": {
    "react-navigation-tabs/react-native-tab-view": "2.11.0"
 },

Thanks for helping me get this solved.

All 6 comments

You should use import { TabBar } from 'react-native-tab-view'; instead of import { tabBar } from 'react-native-tab-view';

i did that too but the TabBar itself is showing errors, i actually uninstalled and installed the single module even tried to re-install the whole node modules but nothing seems working, i am using "react-native-tab-view": "^1.4.1", idk why the file keeps on showing errors of every class imported from react-native-tab-view.

I have the same problem when using react-native-web. I do not use react-native-tab-view directly, it is an indirect import from react-native-tabs. So this breaks react-native-tabs for me. I get the error:

Failed to compile.

./node_modules/react-native-tab-view/lib/module/index.js
"export 'Props' (reexported as 'TabBarProps') was not found in './TabBar'

UPDATE: I saw the export that produces the error has been added 2 days ago. Downgrading to 2.11.0 fixed the problem for me.

@borisvanschooten same issue on latest 2.12.0

I arrived here because this error was being thrown in "react-navigation-tabs", it is worth noting that if you are using yarn you can create a version resolution to work around this:

"resolutions": {
    "react-navigation-tabs/react-native-tab-view": "2.11.0"
 },

Thanks for helping me get this solved.

Hello 👋, this issue has been open for more than 2 months with no activity on it. If the issue is still present in the latest version, please leave a comment within 7 days to keep it open, otherwise it will be closed automatically. If you found a solution on workaround for the issue, please comment here for others to find. If this issue is critical for you, please consider sending a pull request to fix the issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hyochan35 picture hyochan35  Â·  3Comments

chen504554911 picture chen504554911  Â·  3Comments

f6m6 picture f6m6  Â·  3Comments

ashusdn picture ashusdn  Â·  4Comments

AndriiUhryn picture AndriiUhryn  Â·  3Comments