From 7d707894cc30f2734d934f0495446394ea9628d8 Mon Sep 17 00:00:00 2001 From: casperlamboo Date: Thu, 2 Nov 2017 17:41:11 +0100 Subject: [PATCH] move state to constructor --- src/components/AuthImage.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/components/AuthImage.js b/src/components/AuthImage.js index d0b402f..05df41a 100644 --- a/src/components/AuthImage.js +++ b/src/components/AuthImage.js @@ -7,6 +7,14 @@ import PouchDB from 'pouchdb'; // const debug = createDebug('d3d:FileThumb'); class AuthImage extends React.Component { + constructor() { + super(); + + this.state = { + src: null + }; + } + componentWillMount() { const { src, token, password } = this.props; @@ -53,10 +61,6 @@ AuthImage.propTypes = { token: PropTypes.string, password: PropTypes.string }; -AuthImage.state = { - src: null -}; - export default connect(state => ({ token: state.user.session.token,