sorry , wasted 25 min . Current Modal is totally not reusable due to you changing the opacity the actually it should not render in DOM and changing opacity means you can still select it even you dont see it , modal overlay should be inside the modal component not outside, you should consider using React Portal to make Modal bcs it will get position from closest relative and if u have element with relative position it will break all the behavior
@mohamedali92492 жыл бұрын
Right, this is not the we work with modals , changing the opacity made it unusable
@codaid31213 жыл бұрын
Super tuto. Just one thing, I think its better use the condition to show modal. Because even opacity its defined at 0, it always on screen. And it could be a problem if you use it in a component who people use the keyboard to navigate (press tab). If you use: const [show, setShow] = useState(false); { show && } For the performance its better. Sorry for my english 😉
@carloscardoso93834 жыл бұрын
Thanks Very Much. Helped me a lot. Great Job.
@moorzymoores4 жыл бұрын
Superb tutorial. 5/5
@JoaoVictor-ye9vn4 жыл бұрын
hey man, ty from brazil, great job!!!
@CandDev4 жыл бұрын
Obrigado😁
@ekeneidiagbor46783 жыл бұрын
Thanks so much for this great content.
@iAmiina4 жыл бұрын
Thank you so much! So helpful
@markleodionisio26693 жыл бұрын
Thanks brothrr
@lekkyjayz6294 Жыл бұрын
It seems the transition does not work when you close the modal. It closes faster than it opens. Why is that???
@davidernesto79124 жыл бұрын
Tanks bro, it helps me a Lot
@zaritzki3 жыл бұрын
hello, do you have video if the modal is in another component?
@kanhaiyakmr4 жыл бұрын
thanks bro
@raselhossain88553 жыл бұрын
If i click outside the model it's will be colse. How can i add this functionality?
@azure63204 жыл бұрын
Keren bang, saya mau nanya, itu modalnya ngambil space ga bang? Kan disana saya lihat ngubah opacity dari 1 ke 0. Jadi jika ada sebuah component atau misal h1 dibawah button open modal apa dia ngambil space sebesar modal?
@CandDev4 жыл бұрын
dikasus ini ya ngambil space, tapi bisa diakalin dengan style css untuk .modal-wrapper ditambah position: absolute aja, dan diatur ke center component nya.