Preparing search index...

    Function useRecipeOCR

    • Hook for managing OCR workflow in recipe forms.

      This hook orchestrates the complete OCR process for recipe data extraction:

      • Manages OCR modal state for selecting which field to extract
      • Processes images using ML Kit text recognition
      • Populates recipe fields with extracted data
      • Handles validation queues for ingredients and tags with fuzzy matching
      • Manages duplicate detection and merging for ingredients

      Reads the form via useFormContext. The screen-local image gallery and modal mount live in RecipeFormScreen; the OCR hook only triggers extraction and surfaces the in-flight flag.

      Returns UseRecipeOCRReturn

      OCR state and extraction trigger

      const ocr = useRecipeOCR();

      // Process an image for title extraction
      await ocr.fillOneField(imageUri, 'recipeTitle');