From 56d7762801dedb1433ce4bbc5bf7bffdc7726ff2 Mon Sep 17 00:00:00 2001 From: brausjonas Date: Fri, 7 Jul 2023 00:40:06 +0200 Subject: [PATCH] Update App.js --- src/App.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/App.js b/src/App.js index ca0ff1a..84ef354 100644 --- a/src/App.js +++ b/src/App.js @@ -20,6 +20,12 @@ let textInput export default function App() { useLayoutEffect(() => { + + window.addEventListener("beforeunload", e => { + e.preventDefault() + e.returnValue = "" + }) + canvas = document.getElementById("canvas") context = canvas.getContext("2d") clearScreen("rgb(255, 255, 255)") @@ -548,6 +554,7 @@ export default function App() { + ); }