Skip to content

Commit

Permalink
updating to use useCallback for Storage Trends chart
Browse files Browse the repository at this point in the history
  • Loading branch information
wkaspryk committed Mar 27, 2024
1 parent 4816463 commit ea0915e
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/dashboard/src/components/dashboard/Dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,8 @@ export const Dashboard = () => {
[download],
);

const renderStorageTrendsChart = (isLarge: boolean) => {
return (
const renderStorageTrendsChart = React.useCallback(
(isLarge: Boolean) => (
<StorageTrendsChart
large={isLarge}
serverItems={dashboardServerItem ? [dashboardServerItem] : dashboardServerItems}
Expand All @@ -190,8 +190,16 @@ export const Dashboard = () => {
});
}}
/>
);
};
),
[
dashboardServerItem,
dashboardServerItems,
dashboardTenant,
dashboardOrganization,
dashboardOperatingSystemItem,
handleExport,
]
);

return (
<>
Expand Down

0 comments on commit ea0915e

Please sign in to comment.