From f3e3e6d2ca142824c9f3fe21a7c7a15920219887 Mon Sep 17 00:00:00 2001 From: Jori Lallo Date: Sun, 3 Dec 2017 19:21:58 -0800 Subject: [PATCH] props --- app/components/ErrorBoundary/ErrorBoundary.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/components/ErrorBoundary/ErrorBoundary.js b/app/components/ErrorBoundary/ErrorBoundary.js index 02bbc5188..60a380364 100644 --- a/app/components/ErrorBoundary/ErrorBoundary.js +++ b/app/components/ErrorBoundary/ErrorBoundary.js @@ -2,16 +2,23 @@ import React, { Component } from 'react'; import { observer } from 'mobx-react'; import { observable } from 'mobx'; +import type { Location } from 'react-router-dom'; import CenteredContent from 'components/CenteredContent'; import PageTitle from 'components/PageTitle'; +type Props = { + location?: Location, +}; + @observer class ErrorBoundary extends Component { + props: Props; @observable error: boolean = false; componentWillReceiveProps(nextProps: Object) { if ( - (this.props.location || nextProps.location) && + this.props.location && + nextProps.location && this.props.location.pathname !== nextProps.location.pathname ) this.error = false;