skip to Main Content

React beginner. My NavBar gives error of "Uncaught TypeError: Cannot read properties of null (reading 'addEventListener') i cant seem to tell why." – Reactjs

I try to create and use an animated hamburger menu icon instead of already made icons for my Navbar component `const menu = document.querySelector('.menu_button'); const showMenu = document.querySelector('.mobile-nav'); let menuOpen = false; console.log(menu); menu.addEventListener('click', () => { if(!menuOpen){ menu.classList.add('close'); showMenu.classList.add('open');…

VIEW QUESTION

touch : File C:UsersAppDataRoamingnpmtouch.ps1 cannot be loaded because running scripts is disabled on this system – Reactjs

I'm a beginner of learning react and Node.js. When I run touch 'index.js' command in server, It shows 'touch : File C:UserssanduAppDataRoamingnpmtouch.ps1 cannot be loaded because running scripts is disabled on this system. For more information, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.…

VIEW QUESTION
Back To Top
Search