Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
April 22, 2022 04:55 pm GMT

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:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To