is a small and simple package that helps make your React Native app
npm install react-native-drop-shadow
 
The problem is that a shadows does not work with React Native in Android. This view takes its children's, creates a bitmap representation, blur it and color it to styles shadow values like in iOS
yarn add react-native-drop-shadow
React-native < 0.76:
yarn add react-native-drop-shadow@1.0.0
minSdkVersion = 16:
yarn add react-native-drop-shadow@0.0.4
js
import DropShadow from 'react-native-drop-shadow';
`
`js
export default function usage() {
return (
style={{
shadowColor: '#000',
shadowOffset: {
width: 0,
height: 0,
},
shadowOpacity: 1,
shadowRadius: 5,
}}
>
...
);
}
`
#### Usage with FlatList
`js
export default function withFlatList() {
return (
data={['']}
keyExtractor={(item, index) => 'List-' + index}
CellRendererComponent={DropShadow} // <==== add line
renderItem={({ item, index }) => (
style={{
shadowColor: '#000',
shadowOffset: {
width: 0,
height: 0,
},
shadowOpacity: 1,
shadowRadius: 5,
}}
>
...
)}
/>
);
}
`
#### Usage with Animated Views
To make this work in place of an Animated.View, you need to use Animated.createAnimatedComponent to create an animatable version of DropShadow. For example:
`js
const AnimatedDropShadow = Animated.createAnimatedComponent(DropShadow);
export default function withAnimatedViews() {
return (
style={{
shadowColor: '#000',
shadowOffset: {
width: 0,
height: 0,
},
shadowOpacity: 1,
shadowRadius: 5,
}}
>
...
);
}
`
You can then use AnimatedDropShadow in place of Animated.View`.