Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
extractTextFromImage(imagePath) {
RNTesseractOcr.recognize(imagePath, 'LANG_ENGLISH', tessOptions)
.then((result) => {
this.setState({ isLoading: false, extractedText: result });
})
.catch((err) => {
this.setState({ hasErrored: true, errorMessage: err.message });
});
}