3 ms·
Portals can render your branch anywhere, inside the dom or outside in another. The cool thing is that it maintains current state, props and context, even when i
by mlsarecmg 9y ago
Portals can render your branch anywhere, inside the dom or outside in another. The cool thing is that it maintains current state, props and context, even when it's rendered elsewhere. That is insanely useful for common menus, overlaps, popups, annotations, when your container has overflow:hidden and you need to break out, etc. Used to be hacky or hard to realize, now all that's needed is returning a ReactDOM.createPortal(child, dom).