How can i save the data from the scanner into my state? I’ve tried the solution below, but for some reason my this.state.barcodeData is null.
P.S. Aler function works fine.
handleBarCodeScanned = ({ type, data }) => {
this.setState({ scanned: true, barcodeData: data });
alert(
`Bar code with type ${type} and data ${data} has been scanned! \n
`
);
}