Explorar el Código

useCallback here too

Blake Blackshear hace 3 años
padre
commit
3876b00088
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  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);