diff --git a/src/components/App/index.js b/src/components/App/index.js index d6472b2..3affa72 100644 --- a/src/components/App/index.js +++ b/src/components/App/index.js @@ -18,6 +18,8 @@ const syntaxes = { class App extends React.PureComponent { state = {} + image = React.createRef() + componentDidMount() { window.addEventListener('hashchange', this.handleHashChange); this.handleHashChange(); @@ -116,14 +118,12 @@ class App extends React.PureComponent { syntax, expr }, async () => { - await this.image.doReflow(); - this.setSvgUrl(this.image.svg.current); - this.setPngUrl(this.image.svg.current); + await this.image.current.doReflow(); + this.setSvgUrl(this.image.current.svg.current); + this.setPngUrl(this.image.current.svg.current); }); } - imageRef = image => this.image = image - render() { const { svgUrl, pngUrl, permalinkUrl, syntax, expr, image } = this.state; const downloadUrls = [ @@ -146,7 +146,7 @@ class App extends React.PureComponent {

Sample warning message

{ image &&
- +
} ; }