Skip to content

Function does not remove and add class

I have a script that basically is to remove the class “no-js” from the body and add the class “js”, but the script is not working. What did I do wrong? Answer You have to call the function like thie removeClassBody();

Passing a component to the useState() hook

I’m trying to make a system where my App component’s state stores another component, which it will render. Any component should be able to update this state, forcing the App component to re-render. I know how to make the state accessible by any component, but I’m having some issues with rend…

Webpack can’t resolve @import of scss/css

I have a main Stylesheet style.scss, which I imported in my main JavaScript file script.js: This works great, and I could build my website that way in dev mode. Now I wanted to try and use separate Stylesheet and import them in my main stylesheet with the @import rule, like so: But now I get this error messag…