I'm having trouble toggling a class to change the display value to none in my React.js project. Can anyone help troubleshoot this issue?
function sleep(milliseconds:any) {
return new Promise((resolve) => {
setTimeout(resolve, milliseconds);
});
}
async function setHeight(el:any) {
const size = el.current!.scrollHeight === 288;
el.current!.style.setProperty("width", (size) ? "38rem" : "18rem")
el.current!.style.setProperty("height", (size) ? "38rem" : "18rem")
await sleep(500);
circle.current!.classList.toggle("hidden")
}
CSS:
.hidden{
display: none !important;
}