Build A Custom React JS Modal - Using Hooks (Pop-up Window)

แชร์
ฝัง
  • เผยแพร่เมื่อ 27 มี.ค. 2022
  • Build A Modal in React! In this video I will share with you how to build a custom modal (pop-up) in React JS. We will be using the useState hook to toggle our modal and custom css for the styling. The stopPropagation function is implemented to be able to close the modal by clicking outside of the modal! Hope you guys like it and thank you for watching - feedback welcomed!
    ZeroTo Mastery:
    - Master React JS Course - bit.ly/Learn-React-JS
    - Complete Web Developer in 2023 - bit.ly/Complete-Web-Developer...
    Coding Challenges!
    bit.ly/Code-Challenges
    👨‍💻 Github 👨‍💻
    github.com/fireclint/react-modal
    🔥 My Coding Equipment 🔥
    Logitech MX Wireless Keyboard - amzn.to/3xKPFiN
    Logitech MX Master 2S Wireless Mouse - amzn.to/3O5WmRD
    SAMSUNG 49-Inch Gaming Monitor - amzn.to/3mvUy8M
    Shure MV7 USB Podcast Microphone - amzn.to/3O00nqG
    Mic Boom Arm - amzn.to/3NHn6YU
    Monitor Desk Light Bar - amzn.to/3xzKlyj
    ☕ Buy me a Coffee ☕
    www.buymeacoffee.com/clintbriley
    Instagram 💪
    / fireclint

ความคิดเห็น • 64

  • @allanfernz9356
    @allanfernz9356 ปีที่แล้ว +2

    Thank you! This was exactly what I was looking for! Simple and concise! New Sub!

  • @onthegocode1443
    @onthegocode1443 ปีที่แล้ว +3

    Great video! I'm using this to build out my portfolio website and this is a big help!

  • @davidfedchuk4483
    @davidfedchuk4483 11 หลายเดือนก่อน +1

    Helped me get past a bug i've been stuck on for a minute. Thank you!

  • @eliud_karuga
    @eliud_karuga 5 หลายเดือนก่อน

    clear concise and put in an easy way. this is the best one

  • @cryptonicchronic8111
    @cryptonicchronic8111 2 ปีที่แล้ว +2

    watched a lot of tutorials, your fast but clear and explain it easy enough to understand. thanks video rocks

    • @codecommerce
      @codecommerce  2 ปีที่แล้ว

      Means so much - thank you!

  • @melissag3793
    @melissag3793 2 ปีที่แล้ว +2

    Clear & concise, thank you! 🏆

  • @Coastony
    @Coastony ปีที่แล้ว +1

    Nice! Thank you soo much!

  • @fernandogomez5760
    @fernandogomez5760 ปีที่แล้ว

    Capo!!!! bien explicado, simple y SIN librerias!!!!

  • @rammartinez6873
    @rammartinez6873 ปีที่แล้ว +1

    thank you super effective!

  • @salimnihat6966
    @salimnihat6966 ปีที่แล้ว

    Thanks!!. That was awesome

  • @dagi_works
    @dagi_works 2 ปีที่แล้ว +1

    Your videos have taught me a lot man, thank you!

    • @codecommerce
      @codecommerce  2 ปีที่แล้ว +1

      Thank you dude that’s so awesome to hear!

  • @fola_azeez
    @fola_azeez หลายเดือนก่อน

    Thank you. This is amazing

  • @user-vu9dl3vn7l
    @user-vu9dl3vn7l 4 หลายเดือนก่อน

    Thank you so much for this helpful video!

  • @viniciusm.m.7822
    @viniciusm.m.7822 2 ปีที่แล้ว

    Exactly what i need! Thanks man! Abraço!

  • @Gajanan19
    @Gajanan19 4 หลายเดือนก่อน

    Really Great video champ. Thank you! 🏆

  • @roxanaandra
    @roxanaandra 11 หลายเดือนก่อน

    Very good, really helped me!

  • @harny7121
    @harny7121 ปีที่แล้ว

    thanks alot man. super fan

  • @rain25348
    @rain25348 ปีที่แล้ว

    thank you , help me a lot!!

  • @MsDeadParrot
    @MsDeadParrot ปีที่แล้ว

    Thank you ! This was very clear !

  • @prabasri6598
    @prabasri6598 4 หลายเดือนก่อน +1

    You are a saviour!

  • @rbmax33
    @rbmax33 2 ปีที่แล้ว

    Thank you man it is awesome. I appreciate it

  • @shutterbugtraveller1004
    @shutterbugtraveller1004 ปีที่แล้ว

    Thank you!

  • @shahtaz9385
    @shahtaz9385 ปีที่แล้ว

    Thanks man! That was so soothing!

  • @ulisesmak
    @ulisesmak 2 ปีที่แล้ว

    this kind of video are so helpful, tranks man!

  • @mdwaliullah9609
    @mdwaliullah9609 3 หลายเดือนก่อน

    A lot of thanks

  • @ABC-el3ql
    @ABC-el3ql 2 ปีที่แล้ว +1

    HI. I'm a S.Korean fan of yours.
    Your video is very useful to me.
    Especially, the tip for part 'stopPropagation()' was very good.
    Thank you so much!

    • @codecommerce
      @codecommerce  2 ปีที่แล้ว

      Dude that's awesome! Thank you. for that. Yes - I was banging my head until I discovered stopPropagation :)

  • @sylvesterpromise3300
    @sylvesterpromise3300 ปีที่แล้ว +1

    You just got a new subscriber 🙂

  • @devennandapurkar7786
    @devennandapurkar7786 ปีที่แล้ว

    this is was really cool!

  • @lorem1541
    @lorem1541 2 ปีที่แล้ว

    🔥🔥

  • @mantech560
    @mantech560 2 ปีที่แล้ว

    Thank you, this is awesome!

    • @codecommerce
      @codecommerce  2 ปีที่แล้ว +1

      Thank you my friend!

    • @mantech560
      @mantech560 2 ปีที่แล้ว

      @@codecommerce Uwc 🙌

  • @fullkanks2644
    @fullkanks2644 ปีที่แล้ว

    thank you so much you really saved my time

  • @kennedyfreitas7548
    @kennedyfreitas7548 2 ปีที่แล้ว

    thanks a bunch, will be applyng this one with context and some data coming from sanity

    • @codecommerce
      @codecommerce  ปีที่แล้ว +1

      Thank you Kennedy! I haven’t used sanity but it’s something I want to checkout soon!

    • @kennedyfreitas7548
      @kennedyfreitas7548 ปีที่แล้ว

      @@codecommerce think you'll love it dude

  • @faisalahmad100
    @faisalahmad100 2 ปีที่แล้ว

    It’s a really really helpful video❤️❤️

  • @jritzeku
    @jritzeku ปีที่แล้ว +1

    Im guessing the stopPropagation() was needed because our modal content was nested inside the overly content??
    I've seen prior modal examples where overlay and modal sit adjacently and hence never use stopPropagaion.
    However, I do like the nested order of things, seems seems more semantically correct and intuitive.

  • @feastofsteven1214
    @feastofsteven1214 4 หลายเดือนก่อน

    Great video as always, thanks man! I'm having some trouble getting the overlay to work because I am using this to display a menu that is nested in my navbar. So, the open icon is in Navbar.jsx, it opens the modal via Menu.jsx, and hence the 'overlay' only takes on the size of the menu and not the full background. Seems like this method only works if you build it directly in app.js, is that correct?

  • @nandopookey9195
    @nandopookey9195 ปีที่แล้ว

    Thank you sir

  • @jeryngungan
    @jeryngungan ปีที่แล้ว

    In my react code there is notification too many rerenders i cant fix it

  • @edboss36
    @edboss36 ปีที่แล้ว

    If I want to be a comment section of an app as a popup, will this method still be applicable (considering loading lots of comments on the pop up)? thanks

  • @BlazingTyphlosion
    @BlazingTyphlosion ปีที่แล้ว

    Confirmation should always be on the right and cancellation on the left...

  • @jonel5864
    @jonel5864 ปีที่แล้ว

    Why is your open is automatic a varialble?

    • @codecommerce
      @codecommerce  ปีที่แล้ว

      For the sake of the video :)

  • @pinguk9130
    @pinguk9130 2 ปีที่แล้ว

    Can we use this in tailwind css also?

    • @codecommerce
      @codecommerce  2 ปีที่แล้ว

      Absolutely

    • @pinguk9130
      @pinguk9130 2 ปีที่แล้ว

      @@codecommerce can you help me make same with login and signup pop-up?
      I tried the login one but it did not work .

    • @pinguk9130
      @pinguk9130 2 ปีที่แล้ว

      @@codecommerce I tried to make a login pop-up which overlay my home page of the website using tailwind CSS but it didn't work . Please help me

  • @mustafa.celiktas
    @mustafa.celiktas ปีที่แล้ว

    T H A N K Y O U U U U