Repository navigation
Releases: compeso-mgruenwald/react-barcode-scanner
Releases · compeso-mgruenwald/react-barcode-scanner
Release list
v7.0.0
[7.0.0] - 2026-09-12
Breaking
- The built-in viewfinder draws center crosshairs. Pass
viewfinderCrosshairsDisabledto hide them. - Corner marks sit on the cutout edge. The cutout is 15% inset (was 10%).
ViewfinderisReact.ComponentType<{ className?: string; withCrosshairs: boolean }> | null. A custom component may usewithCrosshairsor ignore it.
Added
flashlight. Omit orfalse: no control.true: default button. An object setsclassName,turnOnLabel,turnOffLabel, andonError. Does not turn the lamp on. The button shows only when the live track reports torch support.FlashlightErrorcodes:NO_TRACK,NO_GET_CAPABILITIES,TORCH_MISSING,TORCH_FALSE,TORCH_SEQUENCE_INCOMPLETE,CONSTRAINT_APPLY_FAILED.--rbs-flashlight-iconand--rbs-flashlight-background. Off uses those colors as named. On they swap, and the button gets a box-shadow.
Changed
react-iconspeer is>=4.9(was>=4.8).
v6.0.0
[6.0.0] - 2026-09-10
Breaking
containerStyle,videoContainerStyle, andvideoStyleare gone. Use*ClassNameand--rbs-*.- Layout CSS is
@layer react-barcode-scanner. Name that layer in your@layerlist so later layers override the shipped rules. rbs:videoandvideoClassNamestay on<video>aftervideoProps.videoProps.classNameis ignored.- A function
videoPropsno longer receivesclassNameorstylein its defaults. - A user-facing camera uses
rbs:video-mirrored(scale: -1 1) instead of an inlinetransform.
Added
containerClassName,videoContainerClassName,videoClassName,cameraLoadingClassName,cameraLoadingIconClassName,cameraOffClassName,cameraOffIconClassName, andviewfinderClassName. Each appends after the matchingrbs:*class.--rbs-*custom properties for size, radius, object-fit, viewfinder paint, loader, and camera-off.rbs:video-mirroredforfacingMode: "user".
Changed
- The repo builds with pnpm 12 (was bun).
v5.0.0
[5.0.0] - 2026-09-09
Breaking
- Default camera is now a square 720×720 ideal preview (see default
constraintsbelow). - Default
constraintsare{ facingMode: 'environment', width: { ideal: 720 }, height: { ideal: 720 }, aspectRatio: { ideal: 1 } }. 4.x was{ facingMode: 'environment' }. Passing this prop still replaces the whole default. Viewfinderis a component type ornull. A React element no longer works. Omit it for the built-in overlay. Passnullto hide it.- Layout is CSS classes (
rbs:*) anddist/style.css, imported from the package JS. The old inlineSTYLESobject is gone. doScan={false}or a failure unmounts<video>and shows camera-off. A retry needsdoScanfalse then true, constraint values thatdeepEqualtreats as different, or a remount.
Added
- Built-in viewfinder, a dimmed loader until
HAVE_ENOUGH_DATA, and a camera-off idle view. exports["./style.css"]points atdist/style.css.
Changed
onLoadfires when the preview hasHAVE_ENOUGH_DATA.- An object
videoPropsreplaces the default video attributes, includingstyleandclassName. Loaded-data handling stays with the library.
v4.0.1
[4.0.1] - 2026-09-08
Fixed
- Cleanup now stops the ZXing scan loop.
doScanoff, unmount, and a constraint change used to leave decode running after the camera was gone. - Each
MultiFormatReader: non-ReaderExceptionwarning goes to the console once per started stream. Repeats wait for the next stream.
v4.0.0
[4.0.0] - 2026-09-08
Breaking
- The package is ESM-only. Import with
import { BarcodeScanner } from '@thewirv/react-barcode-scanner'.require()no longer works. main,module, and CJS/requireentry points are gone.development/productionexport conditions and the minified artifacts they pointed at are gone.
Changed
@zxing/browseris now^0.2.1(was^0.1.5).@zxing/libraryis now^0.23.0(was^0.21.3).engines.nodeis gone, as this is not a Node package (>= 18in 3.4.0).- The repo now builds with Vite+ in a bun workspace, and the library has tests.
Fixed
- The camera session no longer restarts when parent callback identities change.
- The stream now stops when
doScanisfalse, on unmount, and when constraints change by value withdeepEqual. - The README default camera is
{ facingMode: "environment" }. 3.4.0's README saiduser. That was a docs typo. Runtime default did not change.
v3.4.0
- Fixed type imports
- Updated dependencies