diff --git a/src/containers/AuthFlowRouteContents.jsx b/src/containers/AuthFlowRouteContents.jsx index 6b0c620..69637a7 100644 --- a/src/containers/AuthFlowRouteContents.jsx +++ b/src/containers/AuthFlowRouteContents.jsx @@ -18,14 +18,21 @@ export default class AuthFlowRouteContents extends Component { component: null }; + _isMounted = false; + componentDidMount() { this.handleProps(this.props); + this._isMounted = true; } componentWillReceiveProps(nextProps: ComponentProps) { this.handleProps(nextProps); } + componentWillUnmount() { + this._isMounted = false; + } + render() { return this.state.component; } @@ -41,6 +48,10 @@ export default class AuthFlowRouteContents extends Component { } onRedirect(path: string) { + if (!this._isMounted) { + return; + } + this.setState({ component: }); @@ -49,6 +60,10 @@ export default class AuthFlowRouteContents extends Component { onRouteAllowed(props: ComponentProps) { const {component: Component} = props; + if (!this._isMounted) { + return; + } + this.setState({ component: });