react-barcode
react-barcode copied to clipboard
How to add the options to the Barcode component?
var barCodeOptions = {
width: 2,
height: 100,
format: "CODE128",
displayValue: true,
fontOptions: "",
font: "monospace",
textAlign: "center",
textPosition: "bottom",
textMargin: 2,
fontSize: 20,
background: "#ffffff",
lineColor: "#000000",
margin: 10,
marginTop: undefined,
marginBottom: undefined,
marginLeft: undefined,
marginRight: undefined
}
------
<Barcode options={barCodeOptions} value={row.itemCodes}/>
This doesn't work.
Try this
<Barcode {...barCodeOptions} value={row.itemCodes}/>