TypeError: undefined is not an object (evaluating '_reactNative.View.propTypes.style') Package.json
"dependencies": {
"@expo/vector-icons": "^13.0.0",
"axios": "^0.27.2",
"expo": "~46.0.9",
"expo-status-bar": "~1.4.0",
"react": "18.0.0",
"react-native": "0.69.5",
"react-native-pager-view": "5.4.24",
"react-native-snap-carousel": "^3.9.1",
"react-native-tab-view": "^3.1.1"
},
Error I'm getting
TypeError: undefined is not an object (evaluating '_reactNative.View.propTypes.style')
And 0 lines of code? Or did you add some new code and the error occurred?
@Sinnbeck
return (
<View style={styles.carousel}>
{articles && (
<Carousel
firstItem={articles.slice(0, 10).length - 1}
layout={"stack"}
data={articles.slice(0, 10)}
sliderHeight={300}
itemHeight={windowHeight}
vertical={true}
renderItem={({ item, index }) => (
<SingleNews item={item} index={index} />
)}
onSnapToItem={(index) => setActiveIndex(index)}
/>
)}
</View>
);
};
Should now be ViewPropTypes.style - one of the packages you are using is legacy
@tykus After adding "react-native-snap-carousel": "^3.9.1", getting error.
But im new to react thus cant track the exact issue which causes this error.
@Sinnbeck should I use this instead of react-native-snap-carousel?
@bigrattle well @tykus already told you the problem and thereby the solution. I am merely pointing out that they are correct as the package is very old. And then I was nice and found an alternative
Please sign in or create an account to participate in this conversation.