Add React.memo to heavy dashboard components
This commit is contained in:
@@ -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>
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user