●PREVIEW — Since 11/24, the preview stays up while Rork rebuilds, so you can keep using the previous version●SONNET 4.5 — Sonnet 4.5 retires from the Claude API on 11/30, 5 days left. Check which model your AI features call●DOCKER — Expo users report the dev server exiting on a debugger request when Metro runs in Docker●NEW — New: The first carousel page is blank at launch? Here's why●2.5 ROUTE — From 12/1, Gemini 2.5 requests reroute to newer models at new rates. 6 days left●PRICING — Before picking a plan, count how often you rebuild in a month — it makes the limit easier to set●PREVIEW — Since 11/24, the preview stays up while Rork rebuilds, so you can keep using the previous version●SONNET 4.5 — Sonnet 4.5 retires from the Claude API on 11/30, 5 days left. Check which model your AI features call●DOCKER — Expo users report the dev server exiting on a debugger request when Metro runs in Docker●NEW — New: The first carousel page is blank at launch? Here's why●2.5 ROUTE — From 12/1, Gemini 2.5 requests reroute to newer models at new rates. 6 days left●PRICING — Before picking a plan, count how often you rebuild in a month — it makes the limit easier to set
Rork × Vision Camera v4: A Production-Grade Camera Stack with QR, OCR, and ML Inference
Wire React Native Vision Camera v4 into a Rork project end-to-end — frame processors, ML inference, QR/OCR, plus battery and thermal tuning, a real-device test matrix, store review, and a staged rollout.
An Expo Camera prototype tends to work within the hour. Then you try to make it shippable, and the work balloons: per-frame processing, recorded audio, fps that behaves differently on every device. None of that is within Expo Camera's reach.
Moving to Vision Camera v4 trades that for a four-way knot of EAS Custom Dev Client, Worklets, iOS AVAudioSession, and Android Camera2. Get one wrong and you may see a black screen on a real iPhone while the simulator runs fine, or QR scanning works and audio recording takes the process down.
From here I'll wire Vision Camera v4 into a Rork project: QR and barcode detection, text recognition with ML Kit, then photo and video capture. The code below is checked against the official docs. Where an earlier version of this article had code that doesn't work, I say so and fix it.
Per-frame work belongs on the camera thread; heavy work gets throttled before it reaches JS. Everything below hangs off that one sentence.
Why Vision Camera v4 instead of Expo Camera
Most Rork templates ship with Expo Camera, and for a basic QR scanner or a one-shot photo, it's perfectly enough. The reason this article uses Vision Camera v4 is that anything serious — anything that needs per-frame work — runs into the limits of Expo Camera fast.
I think about the choice with three questions:
Do I need per-frame access in JS? QR scanning, OCR, and on-device ML inference all need this. Vision Camera v4 lets you do it inside Worklets without blocking the UI thread.
Do I need fine-grained capture control? Things like HDR, ISO, exposure, and focus distance — if you want to tune them like a real camera app, v4 is far easier than Expo Camera.
Do I need to adapt the format per device? Locking everything to 4K@60fps makes low-end devices unstable. Vision Camera v4's useCameraFormat picks from the formats each device actually supports.
If you only need a single QR scan or a single still photo, stay on Expo Camera — you'll save build time and headaches. The trade-off is sharp: don't pay the v4 tax unless you need frame-level work.
Adding Vision Camera v4 to a Rork project: the EAS Custom Dev Client step
Vision Camera v4 ships native modules, so it can't run in Expo Go. After you export from Rork, you need an EAS Custom Dev Client. This is the first wall most teams hit.
# 1. Install Vision Camera and the Worklets runtime (QR/barcodes use the built-in useCodeScanner, so no extra scanner package)npx expo install react-native-vision-cameranpx expo install react-native-worklets-core# 2. Add a Custom Dev Client profile in eas.json# 3. Build the dev clienteas build --profile development --platform ioseas build --profile development --platform android
If you forget react-native-worklets-core, the very first frame processor mount throws JSI is not available. I tripped on this on day one. Frame processors in v4 run on Worklets, so install the two as a pair. Pure QR scanning works without it, but if you might add frame work later, install it from the start.
Add the plugin block to app.json. The microphone copy is read by App Store reviewers, so be specific.
{ "expo": { "plugins": [ [ "react-native-vision-camera", { "cameraPermissionText": "We use the camera to scan QR codes and documents.", "enableCodeScanner": true, "enableLocation": false, "enableMicrophonePermission": true, "microphonePermissionText": "We use the microphone to record audio with video clips." } ] ] }}
On the EAS side, bump the build timeout to 60 minutes for builds that include Vision Camera. The default 30 minutes timed out on me a few times.
✦
Thank you for reading this far.
Continue Reading
What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.
WHAT YOU'LL LEARN
✦A runAtTargetFps-based frame-throttling pattern that keeps long camera sessions cool and battery-friendly
✦A real-device test matrix and the App Store / Play Store review checklist for camera apps
✦API names checked against the official v4 docs (photoQualityBalance, runAtTargetFps, Worklets.createRunOnJS), with the broken snippets fixed
Secure payment via Stripe · Cancel anytime
✦
Unlock This Article
Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.
Permissions and AVAudioSession: kill the iOS landmines first
Before anything else, deal with iOS audio session behavior. Recording with audio enabled can interrupt music playing in another app, which is jarring for users.
// useCameraPermissions.tsimport { useEffect, useState } from "react";import { Camera } from "react-native-vision-camera";export function useCameraPermissions() { const [cameraStatus, setCameraStatus] = useState<string | null>(null); const [micStatus, setMicStatus] = useState<string | null>(null); useEffect(() => { (async () => { let camPerm = await Camera.getCameraPermissionStatus(); if (camPerm !== "granted") { camPerm = await Camera.requestCameraPermission(); } setCameraStatus(camPerm); // Only request the mic if the app actually records audio let micPerm = await Camera.getMicrophonePermissionStatus(); if (micPerm !== "granted") { micPerm = await Camera.requestMicrophonePermission(); } setMicStatus(micPerm); })(); }, []); return { cameraStatus, micStatus };}
That's enough to start. If you also need "don't kill the user's music", record video with audio: false and capture audio separately through AVAudioRecorder configured with mixWithOthers, then mux them later. I'd hold off on this complexity until users actually request it.
On Android, add MODIFY_AUDIO_SETTINGS to the permissions array in app.json next to RECORD_AUDIO. Without it, certain devices have been reported to record audio with parts of the signal missing; test on more than one device, Pixels included.
Real-time QR and barcode detection with frame processors
Now the core of this article. Vision Camera v4's frame processor sends every frame through a Worklet, where you can drop in your own logic. For QR/barcodes, the built-in useCodeScanner is more than enough — no third-party scanner plugin needed.
// QRScannerScreen.tsximport { useRef, useState } from "react";import { StyleSheet, View, Text } from "react-native";import { Camera, useCameraDevice, useCodeScanner,} from "react-native-vision-camera";import { useCameraPermissions } from "./useCameraPermissions";export default function QRScannerScreen() { const device = useCameraDevice("back"); const { cameraStatus } = useCameraPermissions(); const [lastValue, setLastValue] = useState<string | null>(null); const lastRef = useRef<{ value: string; at: number } | null>(null); const codeScanner = useCodeScanner({ codeTypes: ["qr", "ean-13", "code-128", "data-matrix"], onCodeScanned: (codes) => { // The same code fires on every frame, so dedupe by value and time const value = codes[0]?.value; const now = Date.now(); const last = lastRef.current; if (value && (!last || last.value !== value || now - last.at > 3000)) { lastRef.current = { value, at: now }; setLastValue(value); // Trigger your API call or navigation here } }, }); if (cameraStatus !== "granted") { return ( <View style={styles.center}> <Text>Please grant camera access to continue.</Text> </View> ); } if (!device) { return ( <View style={styles.center}> <Text>No camera device available.</Text> </View> ); } return ( <View style={StyleSheet.absoluteFill}> <Camera style={StyleSheet.absoluteFill} device={device} isActive={true} codeScanner={codeScanner} /> {lastValue && ( <View style={styles.banner}> <Text style={styles.bannerText}>Detected: {lastValue}</Text> </View> )} </View> );}const styles = StyleSheet.create({ center: { flex: 1, justifyContent: "center", alignItems: "center" }, banner: { position: "absolute", bottom: 60, left: 20, right: 20, backgroundColor: "rgba(0,0,0,0.7)", padding: 16, borderRadius: 12, }, bannerText: { color: "white", fontSize: 16 },});
onCodeScanned keeps firing as long as the code is visible. If a user holds the camera over a code for two seconds, your callback runs maybe sixty times. Keep the previous value and timestamp in a useRef, as above — comparing against useState inside the callback can read a stale value. Otherwise you'll spam your backend with the same lookup.
A common mistake is "more code types means better detection." It's the opposite. Narrowing codeTypes makes detection faster and reduces false positives. If your app only needs QR, use ["qr"] and nothing else.
ML and OCR: where frame processors end and ML Kit begins
Once you go beyond QR — object detection, OCR, face landmarks — you need an actual ML runtime. Two real choices:
react-native-fast-tflite — runs TensorFlow Lite models directly inside the Worklet. Best when you have your own model
@react-native-ml-kit/text-recognition — wraps Google ML Kit text recognition, with Latin plus Japanese, Chinese, Korean, and Devanagari script options
Here is the boundary that is easy to miss: @react-native-ml-kit/text-recognition takes an image URL (a file path), not a frame buffer. Its README documents one call, TextRecognition.recognize(imageURL, script). An earlier version of this article passed the result of frame.toArrayBuffer() to ML Kit; that combination is not in the library's API, and I'm sorry for the confusion.
To OCR frames directly, you need a native frame processor plugin (your own, or an existing OCR plugin). For documents and receipts, though, taking a throttled photo and handing the file to ML Kit is often enough. Here is code that works:
// OCRScreen.tsx — capture on an interval, read Japanese with ML Kitimport { useEffect, useRef, useState } from "react";import { StyleSheet, Text, View } from "react-native";import { Camera, useCameraDevice } from "react-native-vision-camera";import TextRecognition, { TextRecognitionScript,} from "@react-native-ml-kit/text-recognition";export default function OCRScreen() { const device = useCameraDevice("back"); const camera = useRef<Camera>(null); const busy = useRef(false); // don't start a new pass until the last one ends const [recognized, setRecognized] = useState(""); useEffect(() => { const id = setInterval(async () => { if (busy.current || !camera.current) return; busy.current = true; try { const photo = await camera.current.takePhoto({ enableShutterSound: false, }); const result = await TextRecognition.recognize( `file://${photo.path}`, TextRecognitionScript.JAPANESE ); setRecognized(result.text); } catch (e) { // Retry on the next tick console.warn("OCR failed", e); } finally { busy.current = false; } }, 1000); return () => clearInterval(id); }, []); if (!device) return <View />; return ( <View style={StyleSheet.absoluteFill}> <Camera ref={camera} style={StyleSheet.absoluteFill} device={device} isActive={true} photo={true} photoQualityBalance="speed" /> <View style={styles.textBox}> <Text style={styles.text}>{recognized || "Point at some text"}</Text> </View> </View> );}const styles = StyleSheet.create({ textBox: { position: "absolute", bottom: 80, left: 20, right: 20, backgroundColor: "rgba(0,0,0,0.7)", padding: 16, borderRadius: 12, }, text: { color: "white", fontSize: 14 },});
Three things matter: the busy flag keeps recognition passes from overlapping, photoQualityBalance="speed" shortens each capture, and in production you should clean up the temporary photo files periodically.
OCR can take several hundred milliseconds per pass on some devices, so running it on every frame piles work up. Many people only notice the missing throttle when the phone starts getting warm.
So when do frame processors earn their place? When you want light per-frame work. In v4, runAtTargetFps limits how often the frame processor body runs, and Worklets.createRunOnJS builds the function you call to send a result back to JS:
import { useFrameProcessor } from "react-native-vision-camera";import { Worklets } from "react-native-worklets-core";const onResult = Worklets.createRunOnJS((label: string) => { console.log("detected:", label);});const frameProcessor = useFrameProcessor( (frame) => { "worklet"; // Throttle to 5 fps. Don't use a modulo on frame.timestamp. runAtTargetFps(5, () => { "worklet"; // Light analysis (a custom plugin, say) goes here // const label = detectSomething(frame); // onResult(label); }); }, [onResult]);
The official numbers are a useful yardstick: at 30 fps you have about 33 ms per frame, at 60 fps about 16 ms. Even with runAsync, a 500 ms job effectively runs at 2 fps.
Photo capture: the settings that lift you to production quality
Photo capture looks like a one-liner — camera.takePhoto() — but quality is split between props on the Camera component and options on takePhoto. An earlier version of this article passed qualityPrioritization and enableAutoStabilization to takePhoto; v4's TakePhotoOptions has neither. The corrected version:
<Camera ref={camera} style={StyleSheet.absoluteFill} device={device} isActive={true} photo={true} // Quality vs. speed is a Camera prop photoQualityBalance="quality" // "speed" | "balanced" | "quality"/>const photo = await camera.current?.takePhoto({ flash: flashMode, // "off" | "on" | "auto" enableShutterSound: false,});
What TakePhotoOptions does accept in v4: flash, enableShutterSound, path, and on iOS enableAutoRedEyeReduction and enableAutoDistortionCorrection.
photoQualityBalance="speed" shortens the wait but low-light shots get noisier. For apps where people look back at the photo, use quality; for QR or document flows where speed matters more, speed fits.
Orientation needs care too. Depending on the device and capture orientation, pixels may stay in the sensor's orientation while EXIF's Orientation tag carries the display rotation. Upload that to a server that ignores EXIF and photos show up sideways. The normalization step is covered in the related article linked below.
Video recording: how to choose codec, HDR, and resolution
Video recording is where format choices have the biggest impact on file size and quality. Three knobs decide most of it:
Codec — H.264 (broad compatibility), HEVC (half the size of H.264 at the same quality, default on iOS), AV1 (very new, narrow device support). For SNS sharing, HEVC is great. For business apps where the file may be opened anywhere, stay on H.264
HDR — Pays off in high-contrast outdoor scenes but HDR clips played on LDR displays often look washed out. If you go HDR, plan the playback grading too
Resolution and fps — 4K@60fps eats battery and overheats devices in 5–10 minutes. 1080p@30fps is the universal sweet spot. Pick 1080p@60fps for sports or kids
// VideoRecorder.tsximport { Camera, useCameraDevice, useCameraFormat } from "react-native-vision-camera";const device = useCameraDevice("back");// Pick the best available format from the device's listconst format = useCameraFormat(device, [ { videoResolution: { width: 1920, height: 1080 } }, { fps: 30 }, { videoHdr: false }, // prioritize compatibility]);const startRecording = async () => { await camera.current?.startRecording({ fileType: "mp4", videoCodec: "h265", // HEVC keeps file size down onRecordingFinished: (video) => { // Save video.path or upload it }, onRecordingError: (error) => { console.error("recording error", error); }, });};
On Android, choosing h265 exposes a long-tail playback issue: some devices can't open the file in another app. Build a fallback path to H.264 on Android to avoid "I can't play my video in WhatsApp" support tickets.
Performance tuning: how I think about fps, format, and pixelFormat
Getting the most out of Vision Camera v4 comes down to using useCameraFormat well. This is my template, tuned to stay stable on low-end devices:
import { Camera, useCameraFormat, useCameraDevice } from "react-native-vision-camera";const device = useCameraDevice("back");const format = useCameraFormat(device, [ // Resolution comes first { videoResolution: { width: 1920, height: 1080 } }, // 30 fps as the baseline { fps: 30 }, // HDR off — compatibility and perf win here { videoHdr: false },]);// pixelFormat is a Camera prop, not a format filter<Camera device={device} format={format} fps={30} pixelFormat="yuv" isActive={true} />;
An earlier version listed pixelFormat inside the useCameraFormat filters; it is a Camera prop. Native default is yuv; choose rgb only when your frame processor needs it. The official docs put a 4K frame at roughly 12 MB as yuv versus 31 MB as rgb, which is not a small difference.
The useCameraFormat list is an ordered priority queue: if no format matches the first criterion, it relaxes and tries the next. Chasing 60 fps can leave low-end devices with nothing usable, so keep 30 as the baseline.
Common mistakes you'll hit before launch
Even with the setup above, every device test session uncovers a couple of issues. Roughly in the order people hit them:
Frame processor silently does nothing — usually react-native-worklets-core isn't installed, or the Babel plugin (react-native-worklets-core/plugin) isn't in babel.config.js. Clearing Metro cache and rebuilding tends to surface the real error
iOS device shows a black screen — NSCameraUsageDescription is missing or empty in Info.plist. The dialog never appears and the OS treats it as denied. If you set it via the Expo plugin, run expo prebuild and verify the value made it through
Android recordings end up corrupted — backgrounding the app mid-record corrupts the file. Watch AppState and call stopRecording when the app goes to background
Enabling HDR makes everything choppy — HDR-supporting formats are scarce on cheap devices. Auto-selection can drop fps to 12. Treat HDR as opt-in and only enable it when the user explicitly turns it on
Japanese OCR accuracy is terrible — ML Kit text recognition defaults to the Latin model. Pass the script explicitly — TextRecognition.recognize(url, TextRecognitionScript.JAPANESE) — and Japanese results improve dramatically
These are barely covered in the docs. Hopefully writing them down here saves you the debugging time.
Battery, memory, and thermal behavior in long sessions
The thing nobody warns you about: a camera app that works for sixty seconds at your desk may not hold up for sixty minutes at a wedding. Vision Camera v4's frame pipeline is efficient, but anything you stack on top — encoding, ML inference, network uploads — compounds.
A few rules I follow on camera-heavy apps:
Stop the camera when it's not visible.isActive={false} should follow the screen's focus state. Skip it and the camera keeps running after the user navigates away, and the battery shows it
Drop the resolution while previewing. If your app shows a preview before recording, render the preview at 1280×720 and bump up to 1920×1080 only when the user starts recording. Capture path resolution is independent from preview path
Throttle the frame processor by target fps, not modulo.frame.timestamp % 5 doesn't give you a regular interval, because timestamps aren't consecutive integers. runAtTargetFps keeps working when the device drops frames irregularly
Free the buffer. When you call frame.toArrayBuffer(), the buffer is large. If you hold a reference to it on the JS side, garbage collection lags and memory usage climbs. Once it has crossed to JS, let it go out of scope on both sides
Most of these are invisible until you instrument the app. Wire up Sentry or Firebase Performance to track session duration, thermal state, and memory warnings. Without instrumentation, you only learn about thermal issues from one-star reviews.
Testing strategy: the matrix that catches production bugs
There's no substitute for real devices. Vision Camera v4 has parts that simply don't run in the iOS Simulator (no real camera) and parts that behave differently across Android OEMs (camera implementations differ by manufacturer). A minimum test matrix before any release:
iPhone (current and previous generation): the mainline target. the previous generation still represents a big slice of users
iPhone SE / older: slow A-series chips reveal frame-rate floors that pricier phones hide
Pixel (current generation): Google's reference Android. Most issues replicate here first
Samsung Galaxy mid-range (A-series): the camera HAL most likely to expose codec mismatches
Xiaomi or another low-end Android: low RAM and thermal limits reveal fps drops fast
Run each test scenario on every device:
Open the camera, scan a QR, navigate away, return — verify camera resumes cleanly
Start a 5-minute recording with audio — verify no crash, file plays back in another app
Force-background the app mid-recording — verify no corrupted file
Toggle airplane mode while ML inference is running — verify graceful degradation
Fill the device storage to 90% — verify recording errors out cleanly (not silently)
Automating any of this is hard. Manual checking on physical devices is the only reliable approach I've found, and skipping it always burns me later in the form of bug reports that say "doesn't work on my Galaxy S22".
App Store and Play Store review: what reviewers actually look for
Camera-heavy apps face extra scrutiny in App Store and Play Store reviews. The points reviewers most often flag:
Permission text is generic. "We need camera access" is not enough. Spell out what the camera does for the user — "to scan QR codes for instant payment" or "to capture photos for product listings"
Camera starts before consent. If your camera component mounts before the user grants permission, you may get a privacy rejection. Wrap the <Camera /> mount behind a permission check
Background camera usage. If your app declares background camera capabilities and reviewers can't reproduce a legitimate use case, they reject the build. Don't enable background camera unless you absolutely need it
Video calls without CallKit (iOS). If your camera feature integrates with VoIP, Apple expects you to use CallKit. Bare RTC implementations get flagged
Image upload without privacy disclosure. If photos leave the device, your privacy policy and the App Privacy nutrition label both need to reflect that. Reviewers check the disclosed data types against what the app actually uploads
Plan a 30-minute review pass before each submission. Re-read your permission strings, check the App Privacy fields, and simulate "deny camera access" to make sure the app degrades gracefully. Most camera-related rejections would be caught in that 30 minutes.
Production rollout: feature flags and gradual launch
Camera features have a wider blast radius than most React Native code. A bad release can disable camera functionality across thousands of devices, and "fix" tickets often need a native rebuild — meaning OTA updates won't save you.
My rule is to ship every Vision Camera change behind a remotely controlled feature flag. Concretely:
Codec and resolution defaults are remote-configured. If a specific OS version starts crashing with HEVC, I roll Android over to H.264 in minutes rather than days
The frame processor's heavy work is gated. The OCR feature can be turned off remotely without taking down the camera itself. This means I can ship the camera, then enable OCR for 5% of users, watch crash rates, and roll forward
Migration logic respects rollback. If the new camera screen has an issue, the old route is still in the app and the feature flag points users back. Keep the previous Expo Camera screen in the codebase for at least one minor version cycle after moving to v4
This pattern wouldn't be unusual for a web team, but in mobile it's still under-adopted. The savings on the first incident pay for the overhead many times over. Tools like GrowthBook, Firebase Remote Config, or LaunchDarkly all work — pick one and treat the configuration as part of the camera release.
Adjacent deep dives worth reading next
If you're building a camera-heavy app, the post-capture pipeline is where the bigger wins are. Two natural follow-ups:
Why frame processors work the way they do (and why it matters)
Vision Camera v4's frame processor architecture isn't an arbitrary API choice. Understanding why it looks the way it does saves you from a category of bugs that otherwise look like magic.
When the camera captures a frame, the data lives in native memory — a CMSampleBuffer on iOS, a Image on Android. Bringing that data into JavaScript through a normal bridge call means copying every pixel across the bridge for every frame. At 30 fps with 1080p data, that's roughly 90 MB per second of copies for YUV, or about 250 MB for RGBA. The bridge can't keep up, and you get the classic "frame processor blocks the UI" problem.
Worklets sidestep this by running JavaScript directly on the camera thread, sharing memory with the native frame buffer. There's no copy. The trade-off is that a worklet can't reach back into normal JS state — it's effectively a sandbox with its own scope. This is why patterns like runOnJS(callback)(args) exist: they're the controlled door between the worklet world and the rest of your app.
This shapes how you should design frame-handling code. Anything that needs to run every frame (drawing overlays with Skia, computing exposure compensation, doing fast OCR) belongs inside the worklet. Anything that needs network access, persistence, or React state updates belongs after a runOnJS call, and should be throttled. Mixing these layers — pretending you can call setState from inside a worklet — produces inconsistent crashes that are very hard to debug.
If you're going to spend a lot of time in frame processors, the react-native-vision-camera Frame Processor docs and the worklets-core README repay the time. The mental model that emerges — "worklets are tiny self-contained programs that share memory with the camera, and the JS thread is just a consumer" — clears up a surprising amount of Vision Camera behavior.
A practical decision tree for picking a camera library
There are now a half dozen serious camera libraries in the React Native ecosystem. The decision tree I use looks like this:
Does the app only need a single QR scan or a one-shot photo? Use Expo Camera. The savings in build complexity dominate
Does the app need video recording with audio and basic photo capture? The current expo-camera often covers it
Does the app need real-time analysis of frames (OCR, object detection, AR markers)? Vision Camera is the first candidate
Does the app need GPU-accelerated effects or custom drawing on the preview? Vision Camera v4 + react-native-skia is the de facto stack
Does the app need to integrate with custom hardware (depth sensors, infrared, Lidar)? Vision Camera with a custom native module is the way; alternatives mean rewriting the camera layer in Swift or Kotlin
The mistake that costs the most is over-engineering: picking Vision Camera because "we might need ML features later" and never using frame processors. If you're not sure, start with Expo Camera and migrate later — the migration cost is bounded, and you save the up-front complexity.
A design sketch: a receipt-scanning feature
Here is how the patterns above could combine for an expense tracker that reads the total off a receipt. Treat it as a design sketch, not a field report.
The camera screen has three responsibilities: continuous OCR to find a number that looks like a total, a "tap to capture" gesture for manual confirmation, and a small live preview of the recognized text. The structure:
Capture once a second and recognize with ML Kit (TextRecognitionScript.JAPANESE), never starting a pass before the last one finishes
A debounced React state holding the most recent recognized total, shown in a banner
A capture button calling takePhoto with photoQualityBalance="quality", saving the photo plus the recognized total
A "stop recognizing once the same total has held for a few seconds" check, so a finished scan doesn't keep draining the battery
Build that last check first. Continuous recognition without a stop condition is the usual source of heat. Measure with Sentry or similar, read thermal state, and adjust the interval from real numbers.
Ship a minimum version, add instrumentation, and let real-world traces tell you where to optimize. That order is what I'd suggest for a first Vision Camera project.
Vision Camera V5 is out
This article targets v4. Margelo published V5 in April 2026. Per the official blog, the frame processor engine was rewritten on Nitro, the default Worklets plugin moved from react-native-worklets-core to react-native-worklets, the Formats API was removed, and the code scanner moved to its own package (react-native-vision-camera-barcode-scanner).
So you can't carry this article's code to V5 unchanged. If you maintain a v4 app, read the migration guide and try it on one small screen first. If you're starting fresh, check the V5 docs before anything else.
What to do next
The setup in this guide covers QR scanning, OCR, and production-grade photo/video capture. The next step that pays off the most is wiring the camera into a full pipeline: capture → automatic upload → ML analysis → push notification. A first step: install react-native-vision-camera in your project and get the QR scanner running on a real device. The feel of that first successful read becomes the yardstick for everything after.
Share
Thank You for Reading
Rork Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.