diff --git a/src/Components/DateSwitchBar/Component.tsx b/src/Components/DateSwitchBar/Component.tsx index 9ef33cb..9245c08 100644 --- a/src/Components/DateSwitchBar/Component.tsx +++ b/src/Components/DateSwitchBar/Component.tsx @@ -6,23 +6,23 @@ export class DateSwitchBar extends React.Component<{}, { rotated: boolean }> { constructor(props: {}) { super(props); - this.updateFromProps(props); - this.state = { rotated: false }; + + this.willBeCreated(props); } componentDidMount() { + this.afterUpdated(); + } + + willBeCreated(props: {}) { + this.setState({ rotated: false }); + } + + afterUpdated() { setTimeout(() => { this.setState({ rotated: true }); }, 1000); } - componentWillUpdate(nextProps: {}, nextState: {}) { - this.updateFromProps(nextProps); - } - - updateFromProps(props: {}) { - // do nothing for now - } - render() { const iconClasses = ["icon"]; if (this.state.rotated) {