Skip to content

Commit

Permalink
fix(component): Remove default export from Breadcrumb (#150)
Browse files Browse the repository at this point in the history
`Breadcrumb` is uncallable right now in the standard
convention:

```js
import {Breadcrumb} from "flowbite-react";
```

Since I `export default`'d. This changes that to a
named export so the module can be imported like
above.
  • Loading branch information
tulup-conner authored May 21, 2022
1 parent ffc9e45 commit 511a86c
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/docs/pages/BreadcrumbPage.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { FC } from 'react';
import { HiHome } from 'react-icons/hi';
import Breadcrumb from '../../lib/components/Breadcrumb';
import { Breadcrumb } from '../../lib';

import { CodeExample, DemoPage } from './DemoPage';

Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/Breadcrumb/Breadcrumb.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { render } from '@testing-library/react';
import { HiHome } from 'react-icons/hi';
import Breadcrumb from '.';
import { Breadcrumb } from '.';

describe('Breadcrumb', () => {
describe('given an aria-label', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/Breadcrumb/Breadcrumb.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Meta } from '@storybook/react/types-6-0';
import { HiHome } from 'react-icons/hi';

import Breadcrumb from '.';
import { Breadcrumb } from '.';

export default {
title: 'Components/Breadcrumb',
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/Breadcrumb/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ const BreadcrumbComponent: FC<ComponentProps<'nav'>> = ({ children, ...rest }):
};

BreadcrumbComponent.displayName = 'Breadcrumb';
export default Object.assign(BreadcrumbComponent, { Item: BreadcrumbItem });
export const Breadcrumb = Object.assign(BreadcrumbComponent, { Item: BreadcrumbItem });

0 comments on commit 511a86c

Please sign in to comment.