Skip to content

Commit

Permalink
Addon-docs: Fix "Cannot read property 'props'"
Browse files Browse the repository at this point in the history
  • Loading branch information
shilman committed Nov 6, 2019
1 parent 78669a4 commit 8adf732
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions addons/docs/src/lib/docgenUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,8 @@ export const hasDocgenSection = (obj: any, section: string) =>
export const extractPropsFromDocgen: PropDefGetter = (type, section) => {
const props: Record<string, PropDef> = {};

const docgenInfoProps = type.__docgenInfo[section];
if (!docgenInfoProps) {
return [];
}

const docgenInfo = type.__docgenInfo;
const docgenInfoProps = (docgenInfo && docgenInfo[section]) || {};
const propKeys = Object.keys(docgenInfoProps);
if (propKeys.length === 0) {
return [];
Expand Down

0 comments on commit 8adf732

Please sign in to comment.