qr-code icon indicating copy to clipboard operation
qr-code copied to clipboard

Programmatic rendering

Open chrislondon opened this issue 1 year ago • 2 comments

I'm using React and the library doesn't seem to recognize elements generated on the fly. Is there a programmatic way to generate a QR code?

chrislondon avatar Mar 04 '23 20:03 chrislondon

+1

lanchana avatar Mar 09 '23 14:03 lanchana

Hello guys, I am using this web component in React like this.

import * as qr from "@bitjson/qr-code";

const YourComponent = () => {
     useEffect(() => {qr.defineCustomElements(window)}, [])
     return (
         <>
          <qr-code
              contents="https://bitjson.com"
              style={{ width: "200px", height: "200px" }}></qr-code>
         <>)'
}

I hope it helps!

predam avatar Apr 09 '23 18:04 predam