diff --git a/packages/react-shared/src/ts/components/markdown_section.tsx b/packages/react-shared/src/ts/components/markdown_section.tsx index 682b6ef8f8..95dc83eafb 100644 --- a/packages/react-shared/src/ts/components/markdown_section.tsx +++ b/packages/react-shared/src/ts/components/markdown_section.tsx @@ -19,6 +19,12 @@ export interface MarkdownSectionProps { githubLink?: string; } +interface DefaultMarkdownSectionProps { + headerSize: HeaderSizes; +} + +type PropsWithDefaults = MarkdownSectionProps & DefaultMarkdownSectionProps; + export interface MarkdownSectionState { shouldShowAnchor: boolean; } @@ -34,7 +40,8 @@ export class MarkdownSection extends React.Component
- {!_.isUndefined(this.props.githubLink) && ( + {!_.isUndefined(githubLink) && ( @@ -68,7 +75,7 @@ export class MarkdownSection extends React.Component
{this.props.sidebarHeader} {!_.isUndefined(this.props.versions) && - !_.isUndefined(this.props.selectedVersion) && ( + !_.isUndefined(this.props.selectedVersion) && + !_.isUndefined(this.props.onVersionSelected) && (
- {sectionName} + {finalSectionName} } id={id} diff --git a/packages/react-shared/src/ts/utils/utils.ts b/packages/react-shared/src/ts/utils/utils.ts index ebe896bbc1..9e848392fc 100644 --- a/packages/react-shared/src/ts/utils/utils.ts +++ b/packages/react-shared/src/ts/utils/utils.ts @@ -30,7 +30,7 @@ export const utils = { const id = name.replace(/ /g, '-'); return id; }, - getEtherScanLinkIfExists(addressOrTxHash: string, networkId: number, suffix: EtherscanLinkSuffixes): string { + getEtherScanLinkIfExists(addressOrTxHash: string, networkId: number, suffix: EtherscanLinkSuffixes): string|undefined { const networkName = constants.NETWORK_NAME_BY_ID[networkId]; if (_.isUndefined(networkName)) { return undefined; diff --git a/packages/react-shared/tsconfig.json b/packages/react-shared/tsconfig.json index 44055a0373..de87aa45bf 100644 --- a/packages/react-shared/tsconfig.json +++ b/packages/react-shared/tsconfig.json @@ -4,7 +4,6 @@ "outDir": "./lib/", "jsx": "react", "baseUrl": "./", - "strictNullChecks": false, "paths": { "*": ["node_modules/@types/*", "*"] }