use class property of this.state

This commit is contained in:
afc163 2018-11-06 16:23:53 +08:00
parent adee2f3329
commit c88784a61c

View File

@ -37,15 +37,12 @@ export default class Avatar extends React.Component<AvatarProps, AvatarState> {
size: 'default',
};
private avatarChildren: any;
state = {
scale: 1,
isImgExist: true,
};
constructor(props: AvatarProps) {
super(props);
this.state = {
scale: 1,
isImgExist: true,
};
}
private avatarChildren: any;
componentDidMount() {
this.setScale();