let inner=useRef(); let inner_exit=useRef(); useEffect(()=>{ inner.current=document.querySelectorAll('.inner'); inner_exit.current=document.querySelectorAll('.exit'); inner_exit.current?.[0].addEventListener("click",toogleInner); inner.current?.[0].addEventListener("click",(e)=>{ if(e.target === e.currentTarget) toogleInner(); }); },) const toogleInner = ()=>{ inner.current?.[0].classList.toggle('hide'); }; return ( <div className='inner'> <div className='contentSign'> <div className='form'> <h2>Đăng nhập</h2> <span className='exit'>X</span> </div> </div> ) }; I want when…