Selaa lähdekoodia

useCallback here too

Blake Blackshear 3 vuotta sitten
vanhempi
commit
3876b00088
1 muutettua tiedostoa jossa 2 lisäystä ja 2 poistoa
  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);