Open reboottime opened 1 year ago
withinPortal
property in some of Mantine UI componentsIn Mantine UI, there are several components that support rendering components part using Portal, such as Drawer, Modal, Popover and Select via supporting withInPortal
property.
When using a portal to render a component part under the body element, there are several things to consider
Portal
The createPortal function allows you to render certain children into a different part of the DOM, such as displaying a modal or a drawer outside of the current DOM structure.
One notable thing about
createPortal
is we can't use it on the server side. This is why, in the Portal source code of Manine UI, thecreatePortal
function is invoked after the entire component has been mounted.