Browse Source

useCallback here too

Blake Blackshear 3 năm trước cách đây
mục cha
commit
3876b00088
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  1. 2 2
      web/src/AppBar.jsx

+ 2 - 2
web/src/AppBar.jsx

@@ -42,9 +42,9 @@ export default function AppBar() {
     sendRestart();
   }, [setShowDialog]); // eslint-disable-line react-hooks/exhaustive-deps
 
-  const handleDismissRestartDialog = () => {
+  const handleDismissRestartDialog = useCallback(() => {
     setShowDialog(false);
-  };
+  }, [setShowDialog]);
 
   const handleRestart = useCallback(() => {
     setShowMoreMenu(false);