vemarav / react-native-avatar-crop

Highly customisable <Crop /> component for React Native < 💅 >
https://www.npmjs.com/package/react-native-avatar-crop
MIT License
54 stars 14 forks source link

How onCrop funtion works? #24

Closed yasirwahid closed 3 months ago

yasirwahid commented 3 months ago

I have installed the library successfully , is there any button to crop image? library just show that there is onCrop function which returns the callback but how to call that onCrop function? is there any button which i can't see?

<Crop source={{ uri: image.path }} cropShape={"rect"} // rect || circle width={width} // default value height={height} // defalt value cropArea={{ width, // required height, // required }} borderWidth={0} // default 2 backgroundColor={"#FFFFFF"} // default #FFFFFF, use same format opacity={0.7} // between 0 and 1, default is 1 maxZoom={3} // default 3 resizeMode={"contain"} // default "cover" onCrop={(cropCallback) => (crop = cropCallback)} // returns a function

vemarav commented 3 months ago

crop.current = cropCallback

await crop.current()