From 495a0d6bb26d5b774cd816b0c443e235bad4b862 Mon Sep 17 00:00:00 2001 From: Abhas Bhattacharya Date: Sun, 25 Mar 2018 06:36:13 +0530 Subject: [PATCH] Fix dateswitchbar using setState before mount problem --- src/Components/DateSwitchBar/Component.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Components/DateSwitchBar/Component.tsx b/src/Components/DateSwitchBar/Component.tsx index 9245c08..b26a34b 100644 --- a/src/Components/DateSwitchBar/Component.tsx +++ b/src/Components/DateSwitchBar/Component.tsx @@ -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() {