What would be the best way of incorporating this JS code with React?
document.querySelectorAll(".servicesaffectedtag").forEach((tag) => {
tag.addEventListener("click", (event) => {
tag.classList.toggle("active-tag");
});
});
Is this something that would need to go into the ComponentDidMount() function?
Thanks in advance!