Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.

Commit

Permalink
fix(component): only render elementlist children if there are some
Browse files Browse the repository at this point in the history
  • Loading branch information
Lasse Küchler committed Dec 7, 2017
1 parent 0f6af31 commit 02a7cf7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/component/container/element_list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ export class ElementList extends React.Component<ElementListProps> {
public renderList(item: ListPropsListItem, key?: number): JSX.Element {
return (
<ElementWrapper title={item.value} key={key}>
{item.children && item.children.map((child, index) => this.renderList(child, index))}
{item.children &&
item.children.length > 0 &&
item.children.map((child, index) => this.renderList(child, index))}
</ElementWrapper>
);
}
Expand Down

0 comments on commit 02a7cf7

Please sign in to comment.