mmusaib / react-native-skeleton-loading

React Native's Skeleton Loading Component
https://www.npmjs.com/package/react-native-skeleton-loading
MIT License
13 stars 2 forks source link

'SkeletonLoading' cannot be used as a JSX component. #2

Closed JhosefMatheus closed 3 months ago

JhosefMatheus commented 3 months ago

i did exactly as in the docs: import SkeletonLoading from 'react-native-skeleton-loading'

const App = () => {

return( <SkeletonLoading background={"#adadad"} highlight={"#ffffff"}> <View style={{ flexDirection: 'row', justifyContent: 'space-between' }}> <View style={{ width: 100, height: 100, backgroundColor: "#adadad", borderRadius: 10 }} />

      <View style={{ flex:1, marginLeft: 10 }}>
          <View style={{ backgroundColor: "#adadad", width: "50%", height: 10, marginBottom: 3, borderRadius: 5 }} />
          <View style={{ backgroundColor: "#adadad", width: '20%', height: 8, borderRadius: 5 }} />
          <View style={{ backgroundColor: "#adadad", width: '15%', height: 8, borderRadius: 5, marginTop: 3 }} />
      </View>
    </View>
</SkeletonLoading>

)

};

and its sending me the error that i put on title

mmusaib commented 3 months ago

Are you using it in bare react-native project or Expo project

JhosefMatheus commented 2 months ago

Are you using it in bare react-native project or Expo project

expo project

mmusaib commented 2 months ago

This package is for bare react native, for expo you should use the expo variant of it.

https://github.com/mmusaib/expo-skeleton-loading