@feizheng/react-qrcode
v1.1.1
Published
Qr code for react.
Downloads
135
Readme
react-qrcode
Qr code for react.
installation
npm install -S @feizheng/react-qrcodeupdate
npm update @feizheng/react-qrcodeproperties
| property | type | default | description | | --------- | ------ | ------- | ----------- | | className | String | - | - | | value | String | - | - | | options | Object | - | - |
usage
- import css
@import "~@feizheng/react-qrcode/dist/style.scss";
// customize your styles:
$react-qrcode-options: ()- import js
import ReactQrcode from '../src/main';
import ReactDOM from 'react-dom';
import React from 'react';
import './assets/style.scss';
class App extends React.Component {
state = {
value: 'https://www.baidu.com'
};
changeValue = () => {
console.log('set new value!');
this.setState({ value: 'https://www.mipengine.org/' });
};
render() {
const { value } = this.state;
console.log('value', value);
return (
<div className="app-container">
<ReactQrcode value={value} />
<button className="button" onClick={this.changeValue}>Regenerate</button>
</div>
);
}
}
ReactDOM.render(<App />, document.getElementById('app'));
documentation
- https://afeiship.github.io/react-qrcode/
resources
- https://www.npmjs.com/package/qrcodejs2
