Skip to content

Commit

Permalink
fix: Add a default DashboardPanelWrapper (#1346)
Browse files Browse the repository at this point in the history
- Fixes an issue introduced with #1329
- Wasn't using a stable function as the default wrapper function
  • Loading branch information
mofojed authored Jun 2, 2023
1 parent 210908c commit ddd92cf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
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;

0 comments on commit ddd92cf

Please sign in to comment.