This component depends on react-native-svg. With this component you can clip a image both on android and ios. Since there is an issue about animation on higher version, we recommand using [email protected]
-
Install react-native-svg from
npm
npm install [email protected] --save
-
Link native code
react-native link react-native-svg
-
Install react-native-clip-image from
npm
npm install @unpourtous/react-native-clip-image --save
export default class example extends Component {
render () {
return (
<View style={{flex: 1, alignItems: 'center', justifyContent: 'center'}}>
<ClipImage
style={{
borderRadius: 10
}}
width={300}
height={225}
source={require('./images/monster.png')}
duration={600}/>
</View>
)
}
}