Closed sanduluca closed 3 years ago
Make sure to install react-native-collapsible-tab-view@next
. The current stable version on npm will be deprecated soon.
Thank for your quick reply. I updated the package to next version and replace the default example, but now I get this error
@sanduluca do you get this on v4?
@sanduluca do you get this on v4?
Yes.
"dependencies": {
"...": "...",
"react-native-collapsible-tab-view": "^4.0.0-rc.11",
"...": "..."
}
@sanduluca what version of @types/react-native
do you have installed?
I had to revert to "@types/react-native": "^0.62.0",
in a project due to a similar error. I think something is broken in recent typing versions.
"devDependencies": {
"@types/react-native": "^0.63.46",
"@types/react": "^17.0.0"
}
Try changing it to the one I mentioned in the comment above and run an install again, and see if it helps (reload VSCode afterwards to make sure)
I've tried patch 0.62.0
and there is no error anymore.
Decided to find out from what patch an error will be raised.
So from patch 0.63.41
(included) there are errors with react-native typings.
It's been reported in other libraries:
https://github.com/callstack/react-native-paper/issues/2442
Seems it was broken here:
https://github.com/DefinitelyTyped/DefinitelyTyped/pull/49983
I'll close this since it's an upstream issue.
If you want to use the latest version of react-native
then can add this comment on top of the <ScrollView>
component -
{/* @ts-ignore */}
{/*// @ts-ignore */}
<Tabs.ScrollView>
<Text>Second page</Text>
<Text>Second page</Text>
<Text>Second page</Text>
</Tabs.ScrollView>
For the time being, things are not corrected, can go with this (I know it is not a good thing but still 😓)
workaround without ignoring ts
import {ScrollView} from 'react-native-collapsible-tab-view';
.....
<ScrollView accessibilityComponentType={undefined} accessibilityTraits={undefined}>
.....
</ScrollView>
I get this Typescript error and have no idea how to solve it. There is not
@types/react-native-collapsible-tab-view
. I see that package is written on Typescript, but I get this error. What is wrong ? How should I solve it ?