zpao / qrcode.react

A <QRCode/> component for use with React.

Home Page:https://zpao.github.io/qrcode.react/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to pass parameter

OrganicOat opened this issue · comments

commented

The QRCode is look like unable to pass it value to function, do youguys has any Idea about this?

Do you have an example?

commented

The (e) is undefined when try to pass it into my function, that value work only when scan.

<QRCode size={113} value="hihi" onClick={(value, e) => ZoomInQRCode(e)} />

function ZoomInQRCode(e) {
console.log(e)
}

e is going to be undefined. We don't expose an onClick so you're just getting the raw onClick from the DOM, and the first argument is the event.