An Interest In:
Web News this Week
- March 22, 2024
- March 21, 2024
- March 20, 2024
- March 19, 2024
- March 18, 2024
- March 17, 2024
- March 16, 2024
April 22, 2022 04:55 pm GMT
Original Link: https://dev.to/muneebejaz/react-portals-4o30
React Portals
Raact portals provide a way to render children into a DOM node that exists parent DOM hierarchy.
In react app the div with id root is the entry point, and all the DOM elements exits under root element.
React Portal provide ability to break out of this root and exists anywhere outside the scope of root div.
we will use ReactDom.createPortal()
Original Link: https://dev.to/muneebejaz/react-portals-4o30
Share this article:
Tweet
View Full Article
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To