This content originally appeared on DEV Community and was authored by muneebejazz
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()
This content originally appeared on DEV Community and was authored by muneebejazz
muneebejazz | Sciencx (2022-04-22T16:55:15+00:00) React Portals. Retrieved from https://www.scien.cx/2022/04/22/react-portals/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.