This should be used in two cases
Null
External Modal UI library
You should be able to pass null to layout in order to prevent showing any predefined React Elements.
<ModalContainer layout={null} ... />
Custom layout
You should be able to extend and customize ModalContainer, so you may want to remove predefined layout to make ModalContainer behave like modal provider.
Layout
You should be able to replace predefined layout with ease by passing a layout component with children.
interface ModalLayoutProps {
children: ReactNode
}
function ModalLayout(props: ModalLayoutProps) {
return (
<div className="modal-layout">
{props.children}
</div>
)
}
<ModalContainer layout={ModalLayout} ... />
This should be used in two cases
NullExternal Modal UI library
You should be able to pass
nulltolayoutin order to prevent showing any predefined React Elements.Custom layout
You should be able to extend and customize
ModalContainer, so you may want to remove predefined layout to makeModalContainerbehave like modal provider.Layout
You should be able to replace predefined layout with ease by passing a layout component with
children.