move prototypes outside of class definition

This commit is contained in:
casperlamboo 2017-11-02 17:35:29 +01:00
parent 401f847dfc
commit 4eb19157b6
1 changed files with 10 additions and 11 deletions

View File

@ -6,17 +6,6 @@ import PouchDB from 'pouchdb';
// const debug = createDebug('d3d:FileThumb');
class AuthImage extends React.Component {
static propTypes = {
dispatch: PropTypes.func,
src: PropTypes.string.isRequired,
token: PropTypes.string,
password: PropTypes.string
};
state = {
src: null
}
componentWillMount() {
const { src, token, password } = this.props;
@ -57,6 +46,16 @@ class AuthImage extends React.Component {
return (<img { ...props } src={this.state.src} />);
}
}
AuthImage.propTypes = {
dispatch: PropTypes.func,
src: PropTypes.string.isRequired,
token: PropTypes.string,
password: PropTypes.string
};
AuthImage.state = {
src: null
};
export default connect(state => ({
token: state.user.session.token,