From 462ee292e1da3e33345d891d625f2be9decc67a0 Mon Sep 17 00:00:00 2001 From: Suman Jandhyala Date: Tue, 19 Feb 2019 15:36:00 -0800 Subject: [PATCH 1/3] Fix destructuring bug in Status --- src/modules/Status.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/Status.js b/src/modules/Status.js index 1d5ad99..5476dfe 100644 --- a/src/modules/Status.js +++ b/src/modules/Status.js @@ -24,7 +24,7 @@ export class Status extends React.Component { constructor(props: StatusPropsType, context: StatusContextType) { super(props, context); const { - router: {staticContext}, + router: {staticContext} = {}, } = context; if (staticContext && staticContext.setCode) { staticContext.setCode(parseInt(this.props.code, 10)); From 9e5ffb7662fc2adbbc29cefc38c5d7eb64e946d5 Mon Sep 17 00:00:00 2001 From: Suman Jandhyala Date: Tue, 19 Feb 2019 16:32:04 -0800 Subject: [PATCH 2/3] fix lint --- src/modules/Status.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/modules/Status.js b/src/modules/Status.js index 5476dfe..2620708 100644 --- a/src/modules/Status.js +++ b/src/modules/Status.js @@ -23,9 +23,7 @@ type StatusContextType = { export class Status extends React.Component { constructor(props: StatusPropsType, context: StatusContextType) { super(props, context); - const { - router: {staticContext} = {}, - } = context; + const {router: {staticContext} = {}} = context; if (staticContext && staticContext.setCode) { staticContext.setCode(parseInt(this.props.code, 10)); } From 0a955a941939e14511c1367d7ac32d1e2055131e Mon Sep 17 00:00:00 2001 From: Suman Jandhyala Date: Tue, 19 Feb 2019 17:11:57 -0800 Subject: [PATCH 3/3] make router an optional property for StatusContextType --- src/modules/Status.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/Status.js b/src/modules/Status.js index 2620708..612f125 100644 --- a/src/modules/Status.js +++ b/src/modules/Status.js @@ -14,7 +14,7 @@ type StatusPropsType = { code?: string | number, }; type StatusContextType = { - router: { + router?: { staticContext: { setCode: (code: number) => void, },