Learning React and trying to simply toggle a css class on body tag when a element in my component is clicked. I can't seem to find a good example on how to do it.
Here is how I would do it using Jquery.
function initNav() {
$(".hmbWrapper").click(function() {
$('body').toggleClass('mobileNavActive');
});
}
What is the correct approach in React?
setState, the right question here is how to toggle class using vanilla JavaScript.