Skip to content

Commit

Permalink
clean up qr object
Browse files Browse the repository at this point in the history
  • Loading branch information
austintgriffith committed Oct 22, 2018
1 parent 788cf09 commit 54640e8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 6 additions & 4 deletions src/qrcodedisplay/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ import qrImage from 'qr-image';
import './style.css';

class QRCodeDisplay extends Component {
state = {
constructor() {
super();
img: ''
};
}

componentDidMount() {
this.updateQRCodeImage();
Expand All @@ -26,14 +27,15 @@ class QRCodeDisplay extends Component {
this.setState({ img });
}
}
render = () =>
this.state.img ? (
render() {
return this.state.img ? (
<div
className="qrcode-display-wrapper"
dangerouslySetInnerHTML={{ __html: this.state.img }}
{...this.props}
/>
) : null;
}
}

QRCodeDisplay.propTypes = {
Expand Down

0 comments on commit 54640e8

Please sign in to comment.