I want to add some classes to an element dynamically. I know how to do it with html-dom and how to do it with passing a JavaScript expression to className. But these are not what I want to do. I am wondering if there is a way to add it like pushing that class to an array or concatenating it to a string in that component object.
It is a pseudo-code of what I'm looking for:
const el = <div className='one' />;
// Notice that I'm not using useRef hook.
el.classList.push('two');
// OR:
el.className += ' two';