kciter / react-barcode

A <Barcode/> component for use with React.
http://kciter.github.io/react-barcode/
ISC License
404 stars 72 forks source link

How to add the options to the Barcode component? #33

Open SienaSantos opened 5 years ago

SienaSantos commented 5 years ago
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.

ussada commented 5 years ago

Try this

<Barcode {...barCodeOptions} value={row.itemCodes}/>