I'm referring to the image via require
and I wanted to crop the icons from the sprite image.
const sprite = require('./sprite.png')
const crop = {left: 10, top: 50, width: 20, height: 40}
export const cartLogo = sprite({crop})
// How do I apply the crop to the sprite?
then
<Image source={cartLogo}/>
I see how to crop the image in react-native when using {uri: 'url-to-image', crop: {left: 10, top: 50, width: 20, height: 40}}
in here. How to do it with require
?.