Modal in ReactJS - Code a React Modal Tutorial using Hooks

  Рет қаралды 207,513

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

Пікірлер: 173
@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! :)
@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!
@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!
@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.
@SudaMasakii
@SudaMasakii 2 жыл бұрын
まじで分かりやすい! 詰まってましたけど先に進むことができました!
@wawayltd
@wawayltd 8 ай бұрын
Straight to the point in easy and short manner. Thanks!!
@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.
@orkoren2006
@orkoren2006 2 жыл бұрын
Short and concise Pedro. Thanks!
@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
@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 !
@AnshumanBisoyi
@AnshumanBisoyi Жыл бұрын
Dude you teach so good, want more vids more on animations from you.
@dawoodshahzad9082
@dawoodshahzad9082 3 жыл бұрын
And now another master piece. Thanks buddy!
@PedroTechnologies
@PedroTechnologies 3 жыл бұрын
You bet! Thank you for the support :)
@saidmaroc8448
@saidmaroc8448 3 жыл бұрын
I was looking at WinBox React when you published this post. Top as usual
@PedroTechnologies
@PedroTechnologies 3 жыл бұрын
Hope you enjoyed it!
@Kuena866
@Kuena866 2 жыл бұрын
PedroTech has been added to my favourite coding channels........... Good work
@GilAguilar
@GilAguilar Жыл бұрын
Thanks for the great video, it was very straight forward and simple to follow.
@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🤩🤩🤩🤩🤩
@M4nudu45
@M4nudu45 2 жыл бұрын
it helped me a lot and I really understood, thanks bro :D
@MrAndykofi
@MrAndykofi 2 жыл бұрын
Nice work, subscribed. I like your eloquency.
@ahmedabdelmoneam9279
@ahmedabdelmoneam9279 Жыл бұрын
Very useful, simple and obvious. Thanks
@quirinopls
@quirinopls 2 жыл бұрын
Vlw pedrão, vc é muito brabo cara
@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
@notcountdankula
@notcountdankula 2 жыл бұрын
Thank You. Very Helpful Video
@umadhityamathi6804
@umadhityamathi6804 Жыл бұрын
Very much helpful, In right time. Thank you
@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!
@igorgoncalves5691
@igorgoncalves5691 Жыл бұрын
Nice tutorial Pedro, thanks so much.
@user-lc6jb7so7h
@user-lc6jb7so7h 2 жыл бұрын
this is helpful for me,thank you!!
@gromfader6559
@gromfader6559 2 жыл бұрын
This was great! Thank you!
@gustavokazuo1834
@gustavokazuo1834 2 жыл бұрын
Thank you, I'm brazilian, your video helped me. ;)
@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?
@ccnav7249
@ccnav7249 Жыл бұрын
Wow....That's Fkn awesome Pedro. Really worked 😍😍
@robertramirez8142
@robertramirez8142 2 жыл бұрын
This a tutorial was very helpful thanks.
@joenacouzi558
@joenacouzi558 2 жыл бұрын
You bro are my Reactjs Savior !!!
@austintochukwuasoluka1502
@austintochukwuasoluka1502 2 жыл бұрын
Thank you so much. What's the difference between this approach and using portals?
@Skytrix_limited
@Skytrix_limited 2 жыл бұрын
This was awesome. Thank you
@bubumunhuu4112
@bubumunhuu4112 2 жыл бұрын
Worked thank you a lot.
@parasjangid5721
@parasjangid5721 2 жыл бұрын
This is what i say perfect way to explain.....love from india 😍
@paragbabiya1798
@paragbabiya1798 Жыл бұрын
bro you save my job thank you
@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.
@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 ..
@beekeepingArmenia
@beekeepingArmenia 2 жыл бұрын
Thank You !
@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 :)
@ThColinPereira
@ThColinPereira 3 жыл бұрын
this is so cool, thanks bud
@sophiziia
@sophiziia 6 ай бұрын
Thank you so much!!
@arinzechukwuhillary0zor644
@arinzechukwuhillary0zor644 2 жыл бұрын
Thanks, man for this is helpful
@triptichhetri
@triptichhetri Жыл бұрын
Many Many thanks 🙌
@muhammadjonnazarov146
@muhammadjonnazarov146 Жыл бұрын
Great Tutorial, Thanks alot
@andrealeon8415
@andrealeon8415 2 жыл бұрын
Gracias me ayudaste mucho
@EkUntoldKahaani
@EkUntoldKahaani Жыл бұрын
Thanks mate ❤
@kumardipsaha8964
@kumardipsaha8964 2 жыл бұрын
Thank you so much for this video...🤗🤗🤗
@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!
@SanjayKumar-un7xf
@SanjayKumar-un7xf 2 жыл бұрын
Thanks for sharing knowledge :)
@habibalnoman845
@habibalnoman845 Жыл бұрын
Nice explanation
@edenkefale7129
@edenkefale7129 2 жыл бұрын
Thank you!
@aliciaweenum1248
@aliciaweenum1248 2 жыл бұрын
Great video, thank you
@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 ?
@diegoiturra3134
@diegoiturra3134 Жыл бұрын
thanks for help!
@getuliosouza5512
@getuliosouza5512 2 жыл бұрын
Perfect!
@hastijabbari2413
@hastijabbari2413 3 жыл бұрын
so useful thanks
@hardwired89
@hardwired89 3 жыл бұрын
thanks you pedro 👍👍
@PedroTechnologies
@PedroTechnologies 3 жыл бұрын
Any time!
@kwameaddo1007
@kwameaddo1007 2 жыл бұрын
great video bro,
@oxanasf6369
@oxanasf6369 2 жыл бұрын
Thanks!
@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?
@danielsantiagocuellarmuril2034
@danielsantiagocuellarmuril2034 3 жыл бұрын
muy buen video, gracias amigo!!
@PedroTechnologies
@PedroTechnologies 3 жыл бұрын
De nada, gracias por ver el video :)
@zainabideen8144
@zainabideen8144 Жыл бұрын
What if I want a popup above the content with the backdrop effect?
@francescoanastasio2021
@francescoanastasio2021 29 күн бұрын
Thank you for the video, I have a question: why we opt for position: fixed; here? Wouldn’t absolute make more sense?
@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!!
@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?
@Adam-vm6tc
@Adam-vm6tc 2 жыл бұрын
Thank you sir
@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
@ice12328
@ice12328 Жыл бұрын
Excellent
@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?
@worldclasscode1847
@worldclasscode1847 2 жыл бұрын
Great video! :)
@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.
@growthhacking9126
@growthhacking9126 3 жыл бұрын
Thanks man
@PedroTechnologies
@PedroTechnologies 3 жыл бұрын
Any time!
@sonwander1
@sonwander1 Жыл бұрын
Hello, how to set the modal to open on page load?
@TheCataguases
@TheCataguases 2 жыл бұрын
Como eu faria para avançar de um modal para o outro?
@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!
@MilanDrazic
@MilanDrazic 2 жыл бұрын
you did not show how the content disappeared open modal button when you clicked?
@marypaul9627
@marypaul9627 2 жыл бұрын
good job
@user-cv2ye7ol1m
@user-cv2ye7ol1m 5 ай бұрын
perfect 👍👍
@walterhumphreys671
@walterhumphreys671 2 жыл бұрын
const [display, setDisplay] = React.useState(false); the modal is not listening and it always keeps open, if i use const [display, setDisplay] = React.useState(initialState:false);, i the error The type cast expression is expected to be wrapped with parenthesis,, and if do, const [display, setDisplay] = React.useState({initialState:false}); it still does nothing the modal is always open and close button don't work either
@dragosp.7635
@dragosp.7635 2 жыл бұрын
Can you make a video for cookie policy? (displayed like a modal)
@saurabhranjan4951
@saurabhranjan4951 2 жыл бұрын
Hey could you explain how to use Modals on already existing button?
@gamerpotato2463
@gamerpotato2463 2 жыл бұрын
Wait, the content in the main page is gone when you open the modal.
@praisy01
@praisy01 4 ай бұрын
thank you
@JadeclonOfficial
@JadeclonOfficial 2 жыл бұрын
Hmm, when I download your code and open the modal, the text and open button dont disappear
@uwuslayer0211
@uwuslayer0211 Жыл бұрын
getting Uncaught (in promise) Error: Cannot find module when i try to import the css file even though the css file is in the same directory as the App.js. im trying to import the css by import './form_style.css'
@haian_
@haian_ 2 жыл бұрын
How to close when click outside modal?
@mutazhusam6397
@mutazhusam6397 Жыл бұрын
thx a lot
@Leo-es3fq
@Leo-es3fq 3 жыл бұрын
How can i open new modal from other modal?
@JasurHaydarovChannel
@JasurHaydarovChannel 53 минут бұрын
thanks for video i like
@naumanshigri
@naumanshigri 2 жыл бұрын
xharingmo xng ly mili ata . du liye na liyahmo yod xug .. very help full
@viekva
@viekva 2 жыл бұрын
god bless you!
@user-ul2my3wj4n
@user-ul2my3wj4n 2 жыл бұрын
tnks
@MenixPL
@MenixPL 2 жыл бұрын
What color theme are u use?
@idanbarzilay5289
@idanbarzilay5289 2 жыл бұрын
can you make a video on creating a modal with forwardRef useImperativeHandle?
@akashshrestha01
@akashshrestha01 2 жыл бұрын
great
React Hooks Course - All React Hooks Explained
1:26:21
PedroTech
Рет қаралды 1 МЛН
Search Bar in React Tutorial - Cool Search Filter Tutorial
31:53
WHAT’S THAT?
00:27
Natan por Aí
Рет қаралды 14 МЛН
Пранк пошел не по плану…🥲
00:59
Саша Квашеная
Рет қаралды 6 МЛН
What it feels like cleaning up after a toddler.
00:40
Daniel LaBelle
Рет қаралды 82 МЛН
Build a Modal Component purely in ReactJS and TailwindCSS
6:16
Your Code Lab
Рет қаралды 21 М.
Learn React Portal In 12 Minutes By Building A Modal
12:11
Web Dev Simplified
Рет қаралды 234 М.
React Modal Tutorial Using Hooks and Styled Components
25:14
Brian Design
Рет қаралды 119 М.
Create a Modal With React Portals
13:11
Nikita Dev
Рет қаралды 4,2 М.
Best Way to Add Popup Modals in React
26:19
Colby Fayock
Рет қаралды 5 М.
Top 10 CSS One Liners That Will Blow Your Mind
13:34
developedbyed
Рет қаралды 931 М.
Modal in Next.js & React | Create a Dialog Component
22:57
Dave Gray
Рет қаралды 31 М.
The New dialog HTML Element Changes Modals Forever
12:09
Web Dev Simplified
Рет қаралды 581 М.
Как распознать поддельный iPhone
0:44
PEREKUPILO
Рет қаралды 2,3 МЛН
$1 vs $100,000 Slow Motion Camera!
0:44
Hafu Go
Рет қаралды 28 МЛН