react-native-perspective-image-cropper
react-native-perspective-image-cropper copied to clipboard
The customCrop ref does not have a crop function.
The customCrop ref does not have a crop function and I cannot get the perspective image crop to work. I have console.log of the customCrop ref and the properties are in the attached screenshot below. There is no crop at all. This is the code of the render and crop function. I would appreciate any assistance to get the react-native-perspective-image-cropper to work as intended. My repo can be found at this link: https://github.com/rosenexpend/ScannerImageCropper
function crop() { customCrop.crop(); }
return ( <View> <CustomCrop ref={customCrop} updateImage={updateImage} rectangleCoordinates={rectangleCoordinates} initialImage={image} height={DEFAULT_IMAGE_HEIGHT} width={DEFAULT_IMAGE_WIDTH} overlayColor="rgba(18,190,210, 1)" overlayStrokeColor="rgba(20,190,210, 1)" handlerColor="rgba(20,150,160, 1)" enablePanStrict={false} /> <TouchableHighlight style={styles.cropButtonTouchable} onPress={crop}> <View style={styles.cropButton}> <Text style={styles.cropButtonLabel}>Crop</Text> </View> </TouchableHighlight> </View> ); }

Hey @rosenexpend did you find a solution? I'm getting the same issue as the image is not being cropped.
@rosenexpend @usman64 you seem to use useRef()
try this
customCrop.current.crop()
it actually does have the function, try to addconsole.log() in your updateImage function, you will see the function is being called.