Portal

Portal

import Portal from "@kiwicom/orbit-components/lib/Portal";
<Portal>
// probably Modal
<Modal />
</Portal>

Props

NameTypeDefaultDescription
childrenReact.NodeThe content of the Portal to render. See Functional specs
renderIntostringThe string name of element to be used for the render.

Functional specs

  • <Portal /> component with property renderInto="modal" will render its children into a DOM node that exists outside the DOM hierarchy of the parent component. It means that you have to create div element with id modal (or whatever you want) in root html file. For more info, see React Portal docs.