Michaelvilleneuve / react-native-perspective-image-cropper

Perform custom crop, resizing and perspective correction 📐🖼
MIT License
305 stars 128 forks source link

The customCrop ref does not have a crop function. #51

Open rosentoshev opened 4 years ago

rosentoshev commented 4 years ago

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 (

Crop

); }`

Screenshot 2020-06-30 at 11 40 11

usman64 commented 4 years ago

Hey @rosenexpend did you find a solution? I'm getting the same issue as the image is not being cropped.

Dheeeraj commented 3 years ago

@rosenexpend @usman64 you seem to use useRef()

try this customCrop.current.crop()

venxik commented 3 years ago

it actually does have the function, try to addconsole.log() in your updateImage function, you will see the function is being called.