You can use javascript code in the useEffect
useEffect(() => {
let expand = document.querySelector("#mn-admin-side .expand");
let nav = document.querySelector("#mn-admin-side");
let items = document.querySelectorAll("#mn-admin-side li");
expand.addEventListener("click", () => {
nav.classList.toggle("closed");
});
return () => {}
})