move state to constructor

This commit is contained in:
casperlamboo 2017-11-02 17:41:11 +01:00
parent 193ed418b9
commit 7d707894cc
1 changed files with 8 additions and 4 deletions

View File

@ -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,