From 882d29e2574dc48e446588eb53f8836ea0f8293b Mon Sep 17 00:00:00 2001 From: brausjonas Date: Fri, 7 Jul 2023 01:24:28 +0200 Subject: [PATCH] Update App.js --- src/App.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/App.js b/src/App.js index 7ecaf96..ee5ed53 100644 --- a/src/App.js +++ b/src/App.js @@ -24,6 +24,11 @@ export default function App() { useLayoutEffect(() => { + window.addEventListener("beforeunload", e => { + e.preventDefault() + e.returnValue = "" + }) + canvas = document.getElementById("canvas") context = canvas.getContext("2d")