From a6cdd0a01a558da83cafb8681d3761f642a2d525 Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Sun, 22 Oct 2023 19:24:59 +0800 Subject: [PATCH] Memo for shorcuts --- src/components/shortcuts.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/shortcuts.jsx b/src/components/shortcuts.jsx index e02f76a8..b45a2354 100644 --- a/src/components/shortcuts.jsx +++ b/src/components/shortcuts.jsx @@ -1,6 +1,7 @@ import './shortcuts.css'; import { Menu, MenuItem } from '@szhsin/react-menu'; +import { memo } from 'preact/compat'; import { useMemo, useRef } from 'preact/hooks'; import { useHotkeys } from 'react-hotkeys-hook'; import { useNavigate } from 'react-router-dom'; @@ -186,4 +187,4 @@ function Shortcuts() { ); } -export default Shortcuts; +export default memo(Shortcuts);