File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 1- import type { ReactElement } from "react" ;
1+ import type { ReactElement , ReactNode } from "react" ;
22
33import type { PortalInto } from "./getContainer" ;
44import { Portal } from "./Portal" ;
@@ -27,8 +27,10 @@ export interface RenderConditionalPortalProps {
2727export interface ConditionalPortalProps extends RenderConditionalPortalProps {
2828 /**
2929 * This children to render.
30+ *
31+ * @remarks \@since 4.0.0 Allows `ReactNode` instead of `ReactElement | null`
3032 */
31- children : ReactElement | null ;
33+ children : ReactNode ;
3234}
3335
3436/**
@@ -41,9 +43,9 @@ export function ConditionalPortal({
4143 portalInto,
4244 portalIntoId,
4345 children,
44- } : ConditionalPortalProps ) : ReactElement | null {
46+ } : ConditionalPortalProps ) : ReactElement {
4547 if ( ! portal && ! portalInto && ! portalIntoId ) {
46- return children ;
48+ return < > { children } </ > ;
4749 }
4850
4951 return (
You can’t perform that action at this time.
0 commit comments