From 8ba086c500ba0069afad1377237b27d43b313f60 Mon Sep 17 00:00:00 2001 From: Bryan Pardo Date: Sat, 24 Jun 2023 12:03:02 +0800 Subject: [PATCH] Update Navbar.jsx Toggle class to body prevent scrolling --- src/components/Navbar.jsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/Navbar.jsx b/src/components/Navbar.jsx index fd83ea8..b5be246 100644 --- a/src/components/Navbar.jsx +++ b/src/components/Navbar.jsx @@ -14,7 +14,10 @@ import { Link } from 'react-scroll'; const Navbar = () => { const [nav, setNav] = useState(false); - const handleClick = () => setNav(!nav); + const handleClick = () => { + setNav(!nav); + document.body.classList.toggle("overflow-hidden"); + }; return (