Modal in ReactJS - Code a React Modal Tutorial using Hooks

  Рет қаралды 206,222

PedroTech

PedroTech

3 жыл бұрын

Build a Modal in ReactJS Tutorial. In this video I will show you guys how to build a simple modal in react!
Code: github.com/machadop1407/React...
-
🚀 Learn ReactJS By Building 6 Projects: codedamn.com/learn/reactjs-pr...
💻 PedroTech Discord: / discord
-
Social
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
Website: machadopedro.com
Twitter: / pedrotech_
Linkedin: / machadop1407
Instagram: / _pedro.machado_
Github: github.com/machadop1407
Email: machadop1407@gmail.com
Equipments I Use:
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
🌟 Algorithm Book To Pass Coding Interviews: amzn.to/2Z2CirS
🌟 Microphone: amzn.to/2MKAm4V
🌟 Keyboard: amzn.to/3tvU6ZR
🌟 HD Webcam: amzn.to/3tMpJPD
🌟 Room LED Lights: amzn.to/3a5mFGp
Tags:
- ReactJS Tutorial
- ReactJS and MySQL
- NodeJS Tutorial
- API Tutorial

Пікірлер: 172
@KJMacoustic
@KJMacoustic 2 жыл бұрын
stumped on how to make a modal in react for days because of state and hooks but you made it so easy to understand in this video! Thanks!
@jjrise
@jjrise 2 жыл бұрын
well this was a welcome surprise... I can't tell you why, but this was probably the 15th video I've watched on Hooks and it clicked for me. Your teaching style is fantastic. Keep it up!
@jaia466
@jaia466 2 жыл бұрын
The best channel for me to learn React! The contents are more likely a real world implementation when creating a project especially for a beginner like me. Thanks Pedro! :)
@amanpreetsingh7449
@amanpreetsingh7449 2 жыл бұрын
Thank you so much for this tutorial. I was stuck for some time on how to approach this issue of modal in my project. Short and concised explanation. 👍👍👍👍 Thank you
@rBroneak
@rBroneak 2 жыл бұрын
Thanks for the tutorial. Tip to share back. When you break up you’re content you can use semantic html tags and add few identifiers and layout helpers. No need for all the extra divs and class names until it gets “special”. modal..container > header + section+footer Now you can target all your general modal bits via the parent .modal class. .modal header {} Or scss .modal { header{} section{} footer{} &.modal-special { // now when this class is added to your modal you extend the base styles and add more control header { Something: special; } } } Etc. been working for me for a long time to build and extend components and decorators. I use a prefix on the top level class with cp_ or something to denote its a component (used more than once and has a specific style sheet)
@chandrakant6283
@chandrakant6283 2 жыл бұрын
Brilliantly explained, thanks man. I just needed the right logic to make it work.
@orkoren2006
@orkoren2006 2 жыл бұрын
Short and concise Pedro. Thanks!
@SudaMasakii
@SudaMasakii Жыл бұрын
まじで分かりやすい! 詰まってましたけど先に進むことができました!
@wawayltd
@wawayltd 7 ай бұрын
Straight to the point in easy and short manner. Thanks!!
@dawoodshahzad9082
@dawoodshahzad9082 3 жыл бұрын
And now another master piece. Thanks buddy!
@PedroTechnologies
@PedroTechnologies 3 жыл бұрын
You bet! Thank you for the support :)
@AnshumanBisoyi
@AnshumanBisoyi Жыл бұрын
Dude you teach so good, want more vids more on animations from you.
@joenacouzi558
@joenacouzi558 2 жыл бұрын
in working in a job that requires reactjs and everything i wanna do you have the right tutorial for it . thank you !
@Kuena866
@Kuena866 2 жыл бұрын
PedroTech has been added to my favourite coding channels........... Good work
@saidmaroc8448
@saidmaroc8448 3 жыл бұрын
I was looking at WinBox React when you published this post. Top as usual
@PedroTechnologies
@PedroTechnologies 3 жыл бұрын
Hope you enjoyed it!
@user-yb5cj5np2x
@user-yb5cj5np2x 3 ай бұрын
Thank you so much for making this video seriously very easy way to create custom model . I watch lots of video but this one is superb🤩🤩🤩🤩🤩
@ckh8217
@ckh8217 3 жыл бұрын
Nice channel Pedro! Just a small tip for the close button, I think the HTML-entity "×" looks better than the letter X
@pupil_1
@pupil_1 Жыл бұрын
Better to use font awesome
@GilAguilar
@GilAguilar Жыл бұрын
Thanks for the great video, it was very straight forward and simple to follow.
@ahmedabdelmoneam9279
@ahmedabdelmoneam9279 Жыл бұрын
Very useful, simple and obvious. Thanks
@notcountdankula
@notcountdankula Жыл бұрын
Thank You. Very Helpful Video
@M4nudu45
@M4nudu45 2 жыл бұрын
it helped me a lot and I really understood, thanks bro :D
@dbiswas
@dbiswas Жыл бұрын
This is simply awesome, exactly what I was looking for. But can you also include on how to pass the return value when Cancel v/s continue is selected? Because based on that input you may want to drive other functionality.
@igorgoncalves5691
@igorgoncalves5691 Жыл бұрын
Nice tutorial Pedro, thanks so much.
@user-lc6jb7so7h
@user-lc6jb7so7h 2 жыл бұрын
this is helpful for me,thank you!!
@MrAndykofi
@MrAndykofi 2 жыл бұрын
Nice work, subscribed. I like your eloquency.
@gromfader6559
@gromfader6559 2 жыл бұрын
This was great! Thank you!
@quirinopls
@quirinopls 2 жыл бұрын
Vlw pedrão, vc é muito brabo cara
@umadhityamathi6804
@umadhityamathi6804 Жыл бұрын
Very much helpful, In right time. Thank you
@levyroth
@levyroth 3 жыл бұрын
Dude, make a Patreon or something. Great video as always, so clear and straightforward. You should be teaching CS classes for 1st year students or high school students.
@PedroTechnologies
@PedroTechnologies 3 жыл бұрын
Thank you Levy! Some people asked me about a patreon or something like that but I didn't want to make it without giving any other value out of it. But recently I've been setting up the youtube's membership program and I might turn it active soon. Members will be able to access videos before I post and also have badges next to their names. I also recorded like 80 videos explaining coding interview questions when I was studying but I never posted them hahaha so maybe I will post them for members. I am still a junior in college but I wish I could be a professor lmaoo
@wpxpert98
@wpxpert98 Жыл бұрын
I really like your videos, keep it up
@khizrshaikh9902
@khizrshaikh9902 2 жыл бұрын
Finally Done After 2-3 days Thanks for this buddy
@PedroTechnologies
@PedroTechnologies 2 жыл бұрын
Nice work!
@ccnav7249
@ccnav7249 Жыл бұрын
Wow....That's Fkn awesome Pedro. Really worked 😍😍
@Skytrix_limited
@Skytrix_limited 2 жыл бұрын
This was awesome. Thank you
@gustavokazuo1834
@gustavokazuo1834 2 жыл бұрын
Thank you, I'm brazilian, your video helped me. ;)
@robertramirez8142
@robertramirez8142 2 жыл бұрын
This a tutorial was very helpful thanks.
@bubumunhuu4112
@bubumunhuu4112 2 жыл бұрын
Worked thank you a lot.
@paragbabiya1798
@paragbabiya1798 Жыл бұрын
bro you save my job thank you
@pannihto7588
@pannihto7588 2 жыл бұрын
() => closeModal(false) is a terribly confusing way to close the modal(since the parameter value implies that you're not closing it) . Should have passed closeModal={()=> setModal(false)} and then just call closeModal without any parameters
@synthrunner4244
@synthrunner4244 Жыл бұрын
Better yet, create a handleModal function, and change the state of the modal to = setModal(!isOpen). that way its a function that will alway do the opossite of the value inside the modal open state
@spritemoney
@spritemoney Жыл бұрын
Where is this at in the video?
@arinzechukwuhillary0zor644
@arinzechukwuhillary0zor644 2 жыл бұрын
Thanks, man for this is helpful
@joenacouzi558
@joenacouzi558 2 жыл бұрын
You bro are my Reactjs Savior !!!
@triptichhetri
@triptichhetri Жыл бұрын
Many Many thanks 🙌
@sophiziia
@sophiziia 5 ай бұрын
Thank you so much!!
@muhammadjonnazarov146
@muhammadjonnazarov146 Жыл бұрын
Great Tutorial, Thanks alot
@parasjangid5721
@parasjangid5721 2 жыл бұрын
This is what i say perfect way to explain.....love from india 😍
@SanjayKumar-un7xf
@SanjayKumar-un7xf 2 жыл бұрын
Thanks for sharing knowledge :)
@beekeepingArmenia
@beekeepingArmenia 2 жыл бұрын
Thank You !
@kumardipsaha8964
@kumardipsaha8964 2 жыл бұрын
Thank you so much for this video...🤗🤗🤗
@ThColinPereira
@ThColinPereira 3 жыл бұрын
this is so cool, thanks bud
@EkUntoldKahaani
@EkUntoldKahaani Жыл бұрын
Thanks mate ❤
@edenkefale7129
@edenkefale7129 2 жыл бұрын
Thank you!
@diegoiturra3134
@diegoiturra3134 Жыл бұрын
thanks for help!
@andrealeon8415
@andrealeon8415 Жыл бұрын
Gracias me ayudaste mucho
@austintochukwuasoluka1502
@austintochukwuasoluka1502 2 жыл бұрын
Thank you so much. What's the difference between this approach and using portals?
@aliciaweenum1248
@aliciaweenum1248 2 жыл бұрын
Great video, thank you
@getuliosouza5512
@getuliosouza5512 2 жыл бұрын
Perfect!
@oussamakrab6378
@oussamakrab6378 3 жыл бұрын
Pedro u saved my ass with ur tutorials for my final project thanks buddy
@PedroTechnologies
@PedroTechnologies 3 жыл бұрын
Hahahaha happy to hear it!
@habibalnoman845
@habibalnoman845 Жыл бұрын
Nice explanation
@kwameaddo1007
@kwameaddo1007 2 жыл бұрын
great video bro,
@hastijabbari2413
@hastijabbari2413 3 жыл бұрын
so useful thanks
@oxanasf6369
@oxanasf6369 Жыл бұрын
Thanks!
@PanlasangMotour
@PanlasangMotour 3 жыл бұрын
Awesome !! Kindly implement some crud operation with db with this modal
@PedroTechnologies
@PedroTechnologies 3 жыл бұрын
Hmm I am honestly thinking about making a video incorporating both cool UI stuff and cool backend stuff. I could defo include a modal :)
@Adam-vm6tc
@Adam-vm6tc 2 жыл бұрын
Thank you sir
@ice12328
@ice12328 Жыл бұрын
Excellent
@worldclasscode1847
@worldclasscode1847 2 жыл бұрын
Great video! :)
@danielsantiagocuellarmuril2034
@danielsantiagocuellarmuril2034 3 жыл бұрын
muy buen video, gracias amigo!!
@PedroTechnologies
@PedroTechnologies 3 жыл бұрын
De nada, gracias por ver el video :)
@hardwired89
@hardwired89 3 жыл бұрын
thanks you pedro 👍👍
@PedroTechnologies
@PedroTechnologies 3 жыл бұрын
Any time!
@user-cv2ye7ol1m
@user-cv2ye7ol1m 5 ай бұрын
perfect 👍👍
@praisy01
@praisy01 3 ай бұрын
thank you
@jasonhuang4333
@jasonhuang4333 2 жыл бұрын
Very helpful. Just one question, should we use react.createPortal and render it outside of root div or just use css and html to create a basic modal
@ashishprasad2163
@ashishprasad2163 Жыл бұрын
Using reactDOM.createPortal is the best approach, highly scalable and no dependencies on third party packages.
@clairesingson3331
@clairesingson3331 Жыл бұрын
hi . .good tut . .. just wanna ask if we can make the background transparent so that we would still be seeing our page in the background? do you have a tut regarding that? transparent with modal? thank you ..
@mutazhusam6397
@mutazhusam6397 Жыл бұрын
thx a lot
@francescoanastasio2021
@francescoanastasio2021 8 күн бұрын
Thank you for the video, I have a question: why we opt for position: fixed; here? Wouldn’t absolute make more sense?
@growthhacking9126
@growthhacking9126 3 жыл бұрын
Thanks man
@PedroTechnologies
@PedroTechnologies 3 жыл бұрын
Any time!
@anthonyanselmo9889
@anthonyanselmo9889 2 жыл бұрын
Awesome Video! I was wondering if there is a way to create multiple modals when one closes another opens. For example, I'm creating a site for email templates I use for work. I am trying to get the Modal to open up a form where I insert some information like an email address and a Customers name. I press an enter button in that modal and it will close the form and open the email so I can copy the text. Sorry if this doesn't make sense.
@toivokalev498
@toivokalev498 2 жыл бұрын
Спасибо, друг!
@user-ul2my3wj4n
@user-ul2my3wj4n 2 жыл бұрын
tnks
@marypaul9627
@marypaul9627 2 жыл бұрын
good job
@viekva
@viekva 2 жыл бұрын
god bless you!
@akashshrestha01
@akashshrestha01 2 жыл бұрын
great
@joenacouzi558
@joenacouzi558 2 жыл бұрын
I got a question if i wanna do a modal box where i say this good or this is bad do i create 2 modal.js ? or 2 function or can i do 2 functionalities in 1 ?
@owltrades
@owltrades 3 жыл бұрын
Thanks Pedro for this video, can you please teach us how we can use little bit of animations like smooth scrolling on clicking menu, image unbluring on scrolling to specific section in our web page cause every tutorial sucks they make everything super complicated....
@PedroTechnologies
@PedroTechnologies 3 жыл бұрын
Yeah sure! I am thinking of doing some other UI stuff!
@abdurrakibrony_518
@abdurrakibrony_518 2 жыл бұрын
nice
@konstantinsnihyr3408
@konstantinsnihyr3408 Жыл бұрын
what if multiple pages not only App.js so I have to use useState on every page to open/close modal? do you think this is good solution?
@Usernamesareoutdated
@Usernamesareoutdated 2 жыл бұрын
Many people are calling the Modal from the middle or side of the html document - not from the top. For those who are using the Modal within a nested div and its not centered on the screen, add left:0; right:0; to modalBackground class and change position:relative to position:absolute, and it will take up the expected screen portion.
@ericmomoh7927
@ericmomoh7927 Жыл бұрын
style={{Margin: "auto"}}
@zainabideen8144
@zainabideen8144 Жыл бұрын
What if I want a popup above the content with the backdrop effect?
@henrykibocha5224
@henrykibocha5224 3 жыл бұрын
Thanks for this awesome tut mehn! Can this be a link on the navigation menu eg (signup / login / free trial ) how would that be implemented?
@rangabharath4253
@rangabharath4253 3 жыл бұрын
awesome
@PedroTechnologies
@PedroTechnologies 3 жыл бұрын
:)
@thamismedina6394
@thamismedina6394 Жыл бұрын
I have question, what if a need multiple modals in multiple buttons? how can i do it? is the only way using context?
@Akash-xv5sk
@Akash-xv5sk Жыл бұрын
How to send an image to backend in an existing form like i have multiple input fields, in that i want to append an image, what are the proper way to send an image to backend. like base64 or JSON.stringify or ..???. I appreciate your effort and thankyou
@tanmayhedau5342
@tanmayhedau5342 Жыл бұрын
❤❤
@dragosp.7635
@dragosp.7635 2 жыл бұрын
Can you make a video for cookie policy? (displayed like a modal)
@naumanshigri
@naumanshigri 2 жыл бұрын
xharingmo xng ly mili ata . du liye na liyahmo yod xug .. very help full
@itsmayur4845
@itsmayur4845 Жыл бұрын
hey, I tried this ...my scenario is I am using a button in the form in which Model/popup should be called without rendering the existing form component, but I am unable to do so. Please help!!
@MenixPL
@MenixPL 2 жыл бұрын
What color theme are u use?
@saurabhranjan4951
@saurabhranjan4951 2 жыл бұрын
Hey could you explain how to use Modals on already existing button?
@MilanDrazic
@MilanDrazic 2 жыл бұрын
you did not show how the content disappeared open modal button when you clicked?
@idanbarzilay5289
@idanbarzilay5289 2 жыл бұрын
can you make a video on creating a modal with forwardRef useImperativeHandle?
@sonwander1
@sonwander1 Жыл бұрын
Hello, how to set the modal to open on page load?
@nedath2085
@nedath2085 2 ай бұрын
tnx
@MatheusSilva-qm3ph
@MatheusSilva-qm3ph 3 жыл бұрын
Muito bom...
@augischadiegils.5109
@augischadiegils.5109 2 жыл бұрын
❤️❤️❤️❤️
Why Signals Are Better Than React Hooks
16:30
Web Dev Simplified
Рет қаралды 461 М.
Create a Modal With React Portals
13:11
Nikita Dev
Рет қаралды 3,9 М.
버블티로 체감되는 요즘 물가
00:16
진영민yeongmin
Рет қаралды 115 МЛН
THEY WANTED TO TAKE ALL HIS GOODIES 🍫🥤🍟😂
00:17
OKUNJATA
Рет қаралды 21 МЛН
3M❤️ #thankyou #shorts
00:16
ウエスP -Mr Uekusa- Wes-P
Рет қаралды 14 МЛН
Became invisible for one day!  #funny #wednesday #memes
00:25
Watch Me
Рет қаралды 54 МЛН
Build a Modal Component purely in ReactJS and TailwindCSS
6:16
Your Code Lab
Рет қаралды 19 М.
Search Bar in React Tutorial - Cool Search Filter Tutorial
31:53
React Hooks Course - All React Hooks Explained
1:26:21
PedroTech
Рет қаралды 1 МЛН
Learn React Portal In 12 Minutes By Building A Modal
12:11
Web Dev Simplified
Рет қаралды 232 М.
Build A Custom React JS Modal - Using Hooks (Pop-up Window)
12:27
Code Commerce
Рет қаралды 57 М.
React Like a Pro: React Best Practices
9:55
PedroTech
Рет қаралды 10 М.
React Popup Modal With Tailwind CSS
15:44
Full Stack Niraj
Рет қаралды 34 М.
Как создать Modal Component (Popup) в React | React Modal Component
8:17
Типичный Веб Разработчик
Рет қаралды 4,5 М.
React Redux Tutorial For Beginners | Redux Toolkit Tutorial 2021
53:26
React VS Svelte...10 Examples
8:35
Beyond Fireship
Рет қаралды 531 М.
⚡️Супер БЫСТРАЯ Зарядка | Проверка
1:00
Урна с айфонами!
0:30
По ту сторону Гугла
Рет қаралды 8 МЛН