Skip to content

Commit

Permalink
show all htmlattribute types (#4659)
Browse files Browse the repository at this point in the history
  • Loading branch information
thompsongl authored Mar 23, 2021
1 parent ee9e343 commit d259ee8
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,17 @@ export const GuideSectionPropsDescription: FunctionComponent<GuideSectionPropsDe

const { description, extendedInterfaces } = docgenInfo;

const extendedTypes = extendedInterfaces
const extendedTypes: string[] = extendedInterfaces
? extendedInterfaces.filter((type: any) => !!extendedTypesInfo[type])
: [];

// if all extendedTypes are HTMLAttributes, show them all
// if there is an HTMLAttributes type present among others, remove HTMLAttributes
if (extendedTypes.includes('HTMLAttributes') && extendedTypes.length > 1) {
const htmlAttributesIndex = extendedTypes.indexOf('HTMLAttributes');
extendedTypes.splice(htmlAttributesIndex, 1);
if (!extendedTypes.every((type) => type.indexOf('HTMLAttributes') > -1)) {
if (extendedTypes.includes('HTMLAttributes') && extendedTypes.length > 1) {
const htmlAttributesIndex = extendedTypes.indexOf('HTMLAttributes');
extendedTypes.splice(htmlAttributesIndex, 1);
}
}

const extendedTypesElements = extendedTypes.map((type: any, index: any) => (
Expand Down

0 comments on commit d259ee8

Please sign in to comment.