Stores the element that will contain the portal. By default, it will be the body of the document.

Code examples

const container = document.getElementById("container");
function App() {
return (
<PortalContext.Provider value={container}>
<Portal />

Follow updates

Join 1,000+ subscribers and receive monthly updates with the latest improvements on API Reference.

Read latest issue

No Spam. Unsubscribe at any time.