Skip to content

Commit

Permalink
fix(mui-tree): don't export JsonViewer as default
Browse files Browse the repository at this point in the history
  • Loading branch information
gregmartDOTin committed Nov 21, 2024
1 parent 23f0c96 commit 404861f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/tree/src/lib/JsonViewer.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Meta, StoryObj } from '@storybook/react';

import JsonViewer, { JsonViewerProps } from './JsonViewer';
import { JsonViewer, JsonViewerProps } from './JsonViewer';
// import README from '../README.md';

const meta: Meta<typeof JsonViewer> = {
Expand Down
2 changes: 1 addition & 1 deletion packages/tree/src/lib/JsonViewer.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { render, fireEvent } from '@testing-library/react';
import JsonViewer from './JsonViewer';
import { JsonViewer } from './JsonViewer';

const setup = (data: Record<string, unknown>) => render(<JsonViewer data={data} />);

Expand Down
4 changes: 1 addition & 3 deletions packages/tree/src/lib/JsonViewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@ const getDetails = ({ data }: JsonViewerProps): (JSX.Element | null)[] => {
});
};

const JsonViewer = ({ data, ...rest }: JsonViewerProps): JSX.Element => {
export const JsonViewer = ({ data, ...rest }: JsonViewerProps): JSX.Element => {
const details = getDetails({ data });
return <TreeView {...rest}>{details}</TreeView>;
};

export default JsonViewer;

0 comments on commit 404861f

Please sign in to comment.