Skip to content
This repository has been archived by the owner on May 17, 2019. It is now read-only.

Fix destructuring bug in Status #231

Merged
merged 3 commits into from
Feb 20, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions src/modules/Status.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ type StatusPropsType = {
code?: string | number,
};
type StatusContextType = {
router: {
router?: {
staticContext: {
setCode: (code: number) => void,
},
Expand All @@ -23,9 +23,7 @@ type StatusContextType = {
export class Status extends React.Component<StatusPropsType> {
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));
}
Expand Down