Add React.memo to heavy dashboard components

This commit is contained in:
2026-04-20 20:00:59 +02:00
parent 1d6564aa32
commit 1694ac17f8
7 changed files with 58 additions and 18 deletions

View File

@@ -9,6 +9,7 @@
* via the {@link useServerStatus} hook.
*/
import { memo } from "react";
import {
Badge,
Button,
@@ -68,7 +69,7 @@ const useStyles = makeStyles({
* Render this at the top of the dashboard page (and any page that should
* show live server status).
*/
export function ServerStatusBar(): React.JSX.Element {
export const ServerStatusBar = memo(function ServerStatusBar(): React.JSX.Element {
const styles = useStyles();
const { status, loading, error, refresh } = useServerStatus();
@@ -165,4 +166,4 @@ export function ServerStatusBar(): React.JSX.Element {
</Tooltip>
</div>
);
}
});