Skip to content

Commit 3fdc66b

Browse files
committed
fix(react): pass nested overlay consumer render prop as children for React 18 types
1 parent d5154cd commit 3fdc66b

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

packages/react/src/components/createInlineOverlayComponent.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -289,9 +289,9 @@ export const createInlineOverlayComponent = <PropType, ElementType>(
289289

290290
// Forward the nesting context as a prop to avoid contextType on the class.
291291
const ReactComponentWithNesting: React.FC<IonicReactInternalProps<PropType>> = (props) =>
292-
createElement(NestedOverlayContext.Consumer, null, (isNested: boolean) =>
293-
createElement(ReactComponent, { ...(props as InternalProps), isNested })
294-
);
292+
createElement(NestedOverlayContext.Consumer, {
293+
children: (isNested: boolean) => createElement(ReactComponent, { ...(props as InternalProps), isNested }),
294+
});
295295
ReactComponentWithNesting.displayName = displayName;
296296

297297
return createForwardRef<PropType, ElementType>(ReactComponentWithNesting, displayName);

0 commit comments

Comments
 (0)