+
Using PortalContext
+
This story demonstrates how to use PortalContext to control where Portal content is rendered.
+
+ {/* Default Portal */}
+
+
Default Portal (no context):
+ {mounted ? (
+
+ Content in default portal
+
+ ) : null}
+
+
+ {/* Portal with Context */}
+
+
Portal with PortalContext:
+
+ {mounted ? (
+
+ Content in custom portal (via PortalContext)
+
+ ) : null}
+
+
+
+ {/* Override context with containerName prop */}
+
+
Context + containerName prop override:
+
+ {mounted ? (
+
+ Content overriding context with containerName prop
+
+ ) : null}
+
+
+
+
+ {/* Custom portal containers */}
+