Похожие чаты

Const Modal = ({ onClose }: ModalProps): JSX.Element => (

<dialog open onClose={onClose}>
<h1>Modal</h1>
<p>This is a modal</p>
<button onClick={onClose}>Close</button>
</dialog>
);

function App() {
const [showModal, setShowModal] = useState(false);
return (
<>
<button onClick={() => setShowModal(true)}>Show Modal</button>
{showModal ? <Modal onClose={() => setShowModal(false)} /> : null}
</>
);
}

1 ответов

9 просмотров

dialog element have two feature. 1. backdrop filter that change color of background without need of any element and style. 2. block every element in ui so that you can;t click outside of modal. and for that to happen it's must be open with js.

Похожие вопросы

Обсуждают сегодня

30 BCH videos in Hausa Language successfully delivered. In December 2023, I created a Flipstarter to produce Bitcoin Cash videos in the Hausa language for greater outreach an...
Munnir
5
читать файл максимально быстро? странный вопрос))
zamtmn
53
братва! где куличи брать?
Alöscha
25
тоесть, указав return eax, сгенерируется никому ненужная инструкция mov eax,eax ?
Aiwan \ (•◡•) / _bot
24
Посоветуйте пожалуйста аудио плеер для библиотеки mp3- FLAC на компьютере. На Винде пользовался Aimp, в том числе для конвертации. Много нужных команд было прямо в контекст...
Виктор Кузнецов
31
Is FXTL another frax ecosystem token? Why need fxtl when there is already fxs? Why cant I find a straight answer for this? Maybe thats why people think its all so complicated
MBD Tan
11
Hi guys , do we have update on voting?
HB
16
How Much Btc Falling Down ?
Suriya
22
Hi guys ! Anvil is out ! Time for me to stake on capacity. Does someone has a clear tutorial ? I’m thinking about buying a ledger. Is that really possible to stake directl...
Mister Grega
17
я имею в виду официально интегрированный в телегу? в том плане что не сливает переписку с пользователем?
Andrey
9
Карта сайта