Everything about React Portals in 10 minutes
ฝัง
- เผยแพร่เมื่อ 7 พ.ย. 2024
- In this video you will learn how to use React Portals to create amazing modals in your React App. You will also learn the advantages of React Portals and when and why to use them. You will also learn topics like event delegation and event bubbling.
📚 Materials/References:
VS Code Extensions: • 5 Must Have Visual Stu...
Create react app: reactjs.org/do...
React Portals Docs: reactjs.org/do...
GitHub Code for the project: github.com/Ful...
🧠 Concepts Covered:
React Portals
Event Delegation
Event Bubbling
Creating Modal with Portals
🌎 Find Me Here:
My Website: prasoon.me
LinkedIn: / prosoon-goswami
Twitter: / prasoongoswami4
GitHub: github.com/Ful...
Instagram: / prasoon_goswami
Learnt new thing today.
Thanks alot. Hope it helped you get the topic.
I had to come out here from a well known udemy course.... your explanations was amazing
Glad it helped. Thanks for watching
same here
Keep posting informative video.
Thanks alot
Good work again. Keep posting 🙂
Thank you
Great explanation🤗🤗
Thanks alot
Well explained 👍
Thanks alot
great explaination..
Thanks for watching. Glad this helped
React Portals, beautifully explained. Thanks.
{2023-07-24}
Glad this helped
Great tutorial
Thank you! Cheers!
Thankyou for sharing your knowledge🤝
You're welcome
Well explained
Glad it helped. Thanks for watching
Thank you, Bro! Very helpfull!
Very well explained
Good content. Keep up🙂
Thanks for the feedback
I noticed you had modal : 100% can you not use vh vw?
I've used modals in react without portal.
Absolutely you can use modal without portal. But at times you have situations where you don’t want to render a modal deep inside a nested dom but also want to keep the parent child relationship intact. In these cases portal seems to be much handy.
More over you always want your modal to be above all the contents. Using css will just make it visible at the top but eventually your modal will be nested deep inside decreasing the accessibility of your website.
position : fixed
Position fixed would add the modal to the under the same patent which we do not want portal doesn't only gives us styling options but also provides us the way to render elements out side the nested dom tree.