Skip to content

Commit

Permalink
fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
gracepark committed Sep 5, 2023
1 parent 7904710 commit ad2a14f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
7 changes: 3 additions & 4 deletions src/NavList/NavList.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,10 @@ export const WithNestedSubItems: Story = () => (
<PageLayout>
<PageLayout.Pane position="start">
<NavList>
<NavList.Item defaultOpen={true} href="#">Item 1
<NavList.Item defaultOpen={true} href="#">
Item 1
<NavList.SubNav>
<NavList.Item href="#">
Sub item 1
</NavList.Item>
<NavList.Item href="#">Sub item 1</NavList.Item>
</NavList.SubNav>
</NavList.Item>
<NavList.Item href="#">
Expand Down
6 changes: 3 additions & 3 deletions src/NavList/NavList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ const Item = React.forwardRef<HTMLAnchorElement, NavListItemProps>(
isValidElement(child) ? child.type !== SubNav : true,
)

if (!isValidElement(subNav) && defaultOpen)
// eslint-disable-next-line no-console
console.error('NavList.Item must have a NavList.SubNav to use defaultOpen.')
if (!isValidElement(subNav) && defaultOpen)
// eslint-disable-next-line no-console
console.error('NavList.Item must have a NavList.SubNav to use defaultOpen.')

// Render ItemWithSubNav if SubNav is present
if (subNav && isValidElement(subNav)) {
Expand Down

0 comments on commit ad2a14f

Please sign in to comment.