how to avoid using state but use ref to remove html element?
export default function App() {
const divRef = useRef();
return (
<div className="App">
<div ref={divRef}>
<div
onClick={() => {
console.log(divRef.current);
}}
>
click to remove this node
</div>
</div>
</div>
);
}
removeChildren don't exist on current?