move state to constructor

This commit is contained in:
casperlamboo 2017-11-02 17:41:11 +01:00
parent 193ed418b9
commit 7d707894cc

View File

@ -7,6 +7,14 @@ import PouchDB from 'pouchdb';
// const debug = createDebug('d3d:FileThumb'); // const debug = createDebug('d3d:FileThumb');
class AuthImage extends React.Component { class AuthImage extends React.Component {
constructor() {
super();
this.state = {
src: null
};
}
componentWillMount() { componentWillMount() {
const { src, token, password } = this.props; const { src, token, password } = this.props;
@ -53,10 +61,6 @@ AuthImage.propTypes = {
token: PropTypes.string, token: PropTypes.string,
password: PropTypes.string password: PropTypes.string
}; };
AuthImage.state = {
src: null
};
export default connect(state => ({ export default connect(state => ({
token: state.user.session.token, token: state.user.session.token,