Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Add a default DashboardPanelWrapper #1346

Merged
merged 1 commit into from
Jun 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/dashboard/src/DashboardLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import {
PanelHydrateFunction,
PanelProps,
} from './DashboardPlugin';
import DashboardPanelWrapper from './DashboardPanelWrapper';

export type DashboardLayoutConfig = ItemConfigType[];

Expand Down Expand Up @@ -82,8 +83,7 @@ export function DashboardLayout({
onLayoutInitialized = DEFAULT_CALLBACK,
hydrate = hydrateDefault,
dehydrate = dehydrateDefault,
// eslint-disable-next-line react/jsx-no-useless-fragment
panelWrapper = ({ children: panelChildren }) => <>{panelChildren}</>,
panelWrapper = DashboardPanelWrapper,
}: DashboardLayoutProps): JSX.Element {
const dispatch = useDispatch();
const data =
Expand Down
8 changes: 8 additions & 0 deletions packages/dashboard/src/DashboardPanelWrapper.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import React, { PropsWithChildren } from 'react';

export function DashboardPanelWrapper({ children }: PropsWithChildren<object>) {
// eslint-disable-next-line react/jsx-no-useless-fragment
return <>{children}</>;
}

export default DashboardPanelWrapper;