How to use the qrcode.es.qrcode function in qrcode

To help you get started, we’ve selected a few qrcode examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github AdactiveSAS / adsum-react-components / packages / adsum-qrCode / src / AdsumQrCode.js View on Github external
componentDidUpdate(prevProps: PropsType) {
        if (!prevProps.isOpen && this.props.isOpen) {
            const element = document.getElementById('qrCode');
            this.qrCode = new qrcode(element);

            this.qrCode.generate(this.props.text, this.props.qrCodeOptions).then(() => {
                this.setState({
                    showModal: true,
                });
            });
        } else if (prevProps.isOpen && !this.props.isOpen) {
            this.qrCode = null;
            this.setState({
                showModal: false,
            });
        }
    }