Skip to content

Releases: compeso-mgruenwald/react-barcode-scanner

v7.0.0

Choose a tag to compare

@compeso-mgruenwald compeso-mgruenwald released this 11 Sep 22:58
5f1a37f

[7.0.0] - 2026-09-12

Breaking

  • The built-in viewfinder draws center crosshairs. Pass viewfinderCrosshairsDisabled to hide them.
  • Corner marks sit on the cutout edge. The cutout is 15% inset (was 10%).
  • Viewfinder is React.ComponentType<{ className?: string; withCrosshairs: boolean }> | null. A custom component may use withCrosshairs or ignore it.

Added

  • flashlight. Omit or false: no control. true: default button. An object sets className, turnOnLabel, turnOffLabel, and onError. Does not turn the lamp on. The button shows only when the live track reports torch support.
  • FlashlightError codes: NO_TRACK, NO_GET_CAPABILITIES, TORCH_MISSING, TORCH_FALSE, TORCH_SEQUENCE_INCOMPLETE, CONSTRAINT_APPLY_FAILED.
  • --rbs-flashlight-icon and --rbs-flashlight-background. Off uses those colors as named. On they swap, and the button gets a box-shadow.

Changed

  • react-icons peer is >=4.9 (was >=4.8).

v6.0.0

Choose a tag to compare

@compeso-mgruenwald compeso-mgruenwald released this 10 Sep 13:24
a061cd7

[6.0.0] - 2026-09-10

Breaking

  • containerStyle, videoContainerStyle, and videoStyle are gone. Use *ClassName and --rbs-*.
  • Layout CSS is @layer react-barcode-scanner. Name that layer in your @layer list so later layers override the shipped rules.
  • rbs:video and videoClassName stay on <video> after videoProps. videoProps.className is ignored.
  • A function videoProps no longer receives className or style in its defaults.
  • A user-facing camera uses rbs:video-mirrored (scale: -1 1) instead of an inline transform.

Added

  • containerClassName, videoContainerClassName, videoClassName, cameraLoadingClassName, cameraLoadingIconClassName, cameraOffClassName, cameraOffIconClassName, and viewfinderClassName. Each appends after the matching rbs:* class.
  • --rbs-* custom properties for size, radius, object-fit, viewfinder paint, loader, and camera-off.
  • rbs:video-mirrored for facingMode: "user".

Changed

  • The repo builds with pnpm 12 (was bun).

v5.0.0

Choose a tag to compare

@compeso-mgruenwald compeso-mgruenwald released this 09 Sep 11:45
20fadff

[5.0.0] - 2026-09-09

Breaking

  • Default camera is now a square 720×720 ideal preview (see default constraints below).
  • Default constraints are { facingMode: 'environment', width: { ideal: 720 }, height: { ideal: 720 }, aspectRatio: { ideal: 1 } }. 4.x was { facingMode: 'environment' }. Passing this prop still replaces the whole default.
  • Viewfinder is a component type or null. A React element no longer works. Omit it for the built-in overlay. Pass null to hide it.
  • Layout is CSS classes (rbs:*) and dist/style.css, imported from the package JS. The old inline STYLES object is gone.
  • doScan={false} or a failure unmounts <video> and shows camera-off. A retry needs doScan false then true, constraint values that deepEqual treats 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 at dist/style.css.

Changed

  • onLoad fires when the preview has HAVE_ENOUGH_DATA.
  • An object videoProps replaces the default video attributes, including style and className. Loaded-data handling stays with the library.

v4.0.1

Choose a tag to compare

@compeso-mgruenwald compeso-mgruenwald released this 08 Sep 11:29
8be3d86

[4.0.1] - 2026-09-08

Fixed

  • Cleanup now stops the ZXing scan loop. doScan off, unmount, and a constraint change used to leave decode running after the camera was gone.
  • Each MultiFormatReader: non-ReaderException warning goes to the console once per started stream. Repeats wait for the next stream.

v4.0.0

Choose a tag to compare

@compeso-mgruenwald compeso-mgruenwald released this 08 Sep 08:23
1e9753b

[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/require entry points are gone.
  • development / production export conditions and the minified artifacts they pointed at are gone.

Changed

  • @zxing/browser is now ^0.2.1 (was ^0.1.5). @zxing/library is now ^0.23.0 (was ^0.21.3).
  • engines.node is gone, as this is not a Node package (>= 18 in 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 doScan is false, on unmount, and when constraints change by value with deepEqual.
  • The README default camera is { facingMode: "environment" }. 3.4.0's README said user. That was a docs typo. Runtime default did not change.

v3.4.0

Choose a tag to compare

@compeso-mgruenwald compeso-mgruenwald released this 17 Jun 09:29
1a387dc
  • Fixed type imports
  • Updated dependencies

v3.3.5

Choose a tag to compare

@thewirv thewirv released this 31 May 07:43
01588f5
  • Removed a few default video props

v3.3.4

Choose a tag to compare

@thewirv thewirv released this 31 May 06:52
6545ba8
  • Added videoProps prop to override/extend the props that are passed to the underlying video element

v3.3.3

Choose a tag to compare

@thewirv thewirv released this 24 May 13:01
3c36cad
  • Added default export to package.json

v3.3.2

Choose a tag to compare

@thewirv thewirv released this 24 May 11:35
b90fe07
  • Fixed module resolution issues