Fix dateswitchbar using setState before mount problem

This commit is contained in:
2018-03-25 06:36:13 +05:30
parent 20eb3aa728
commit 495a0d6bb2
+1 -2
View File
@@ -6,7 +6,6 @@ export class DateSwitchBar extends React.Component<{}, { rotated: boolean }> {
constructor(props: {}) {
super(props);
this.state = { rotated: false };
this.willBeCreated(props);
}
@@ -16,7 +15,7 @@ export class DateSwitchBar extends React.Component<{}, { rotated: boolean }> {
}
willBeCreated(props: {}) {
this.setState({ rotated: false });
this.state = { rotated: false };
}
afterUpdated() {