Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

bigrattle's avatar

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')
0 likes
9 replies
Sinnbeck's avatar

And 0 lines of code? Or did you add some new code and the error occurred?

bigrattle's avatar

@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>
  );
};
tykus's avatar

Should now be ViewPropTypes.style - one of the packages you are using is legacy

bigrattle's avatar

@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's avatar

@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

1 like

Please or to participate in this conversation.