+>DropdownMenu : Symbol(DropdownMenu, Decl(contextuallyTypedJsxChildren.tsx, 2, 26), Decl(contextuallyTypedJsxChildren.tsx, 23, 13))
+>icon : Symbol(icon, Decl(contextuallyTypedJsxChildren.tsx, 25, 13))
+>label : Symbol(label, Decl(contextuallyTypedJsxChildren.tsx, 25, 25))
+
+ {({ onClose }) => (
+>onClose : Symbol(onClose, Decl(contextuallyTypedJsxChildren.tsx, 26, 5))
+
+
+>div : Symbol(JSX.IntrinsicElements.div, Decl(react16.d.ts, 2546, 114))
+
+
+>button : Symbol(JSX.IntrinsicElements.button, Decl(react16.d.ts, 2532, 96))
+>onClick : Symbol(onClick, Decl(contextuallyTypedJsxChildren.tsx, 28, 13))
+>onClose : Symbol(onClose, Decl(contextuallyTypedJsxChildren.tsx, 26, 5))
+>button : Symbol(JSX.IntrinsicElements.button, Decl(react16.d.ts, 2532, 96))
+
+
+>div : Symbol(JSX.IntrinsicElements.div, Decl(react16.d.ts, 2546, 114))
+
+ )}
+;
+>DropdownMenu : Symbol(DropdownMenu, Decl(contextuallyTypedJsxChildren.tsx, 2, 26), Decl(contextuallyTypedJsxChildren.tsx, 23, 13))
+
+DropdownMenu : Symbol(DropdownMenu, Decl(contextuallyTypedJsxChildren.tsx, 2, 26), Decl(contextuallyTypedJsxChildren.tsx, 23, 13))
+
+ icon="move"
+>icon : Symbol(icon, Decl(contextuallyTypedJsxChildren.tsx, 33, 13))
+
+ label="Select a direction"
+>label : Symbol(label, Decl(contextuallyTypedJsxChildren.tsx, 34, 13))
+
+ children={({ onClose }) => (
+>children : Symbol(children, Decl(contextuallyTypedJsxChildren.tsx, 35, 28))
+>onClose : Symbol(onClose, Decl(contextuallyTypedJsxChildren.tsx, 36, 14))
+
+
+>div : Symbol(JSX.IntrinsicElements.div, Decl(react16.d.ts, 2546, 114))
+
+
+>button : Symbol(JSX.IntrinsicElements.button, Decl(react16.d.ts, 2532, 96))
+>onClick : Symbol(onClick, Decl(contextuallyTypedJsxChildren.tsx, 38, 13))
+>onClose : Symbol(onClose, Decl(contextuallyTypedJsxChildren.tsx, 36, 14))
+>button : Symbol(JSX.IntrinsicElements.button, Decl(react16.d.ts, 2532, 96))
+
+
+>div : Symbol(JSX.IntrinsicElements.div, Decl(react16.d.ts, 2546, 114))
+
+ )}
+/>;
+
diff --git a/tests/baselines/reference/contextuallyTypedJsxChildren.types b/tests/baselines/reference/contextuallyTypedJsxChildren.types
new file mode 100644
index 00000000000..4b1e13dfa56
--- /dev/null
+++ b/tests/baselines/reference/contextuallyTypedJsxChildren.types
@@ -0,0 +1,106 @@
+=== tests/cases/compiler/contextuallyTypedJsxChildren.tsx ===
+///
+
+import React from 'react';
+>React : typeof React
+
+// repro from https://github.com/microsoft/TypeScript/issues/53941
+declare namespace DropdownMenu {
+ interface BaseProps {
+ icon: string;
+>icon : string
+
+ label: string;
+>label : string
+ }
+ interface PropsWithChildren extends BaseProps {
+ children(props: { onClose: () => void }): JSX.Element;
+>children : (props: { onClose: () => void;}) => JSX.Element
+>props : { onClose: () => void; }
+>onClose : () => void
+>JSX : any
+
+ controls?: never | undefined;
+>controls : undefined
+ }
+ interface PropsWithControls extends BaseProps {
+ controls: Control[];
+>controls : Control[]
+
+ children?: never | undefined;
+>children : undefined
+ }
+ interface Control {
+ title: string;
+>title : string
+ }
+ type Props = PropsWithChildren | PropsWithControls;
+>Props : PropsWithChildren | PropsWithControls
+}
+declare const DropdownMenu: React.ComponentType;
+>DropdownMenu : React.ComponentType
+>React : any
+>DropdownMenu : any
+
+
+> {({ onClose }) => (
)} : JSX.Element
+>DropdownMenu : React.ComponentType
+>icon : string
+>label : string
+
+ {({ onClose }) => (
+>({ onClose }) => (
) : ({ onClose }: { onClose: () => void; }) => JSX.Element
+>onClose : () => void
+>(
) : JSX.Element
+
+
+>
: JSX.Element
+>div : any
+
+
+>
: JSX.Element
+>button : any
+>onClick : () => void
+>onClose : () => void
+>button : any
+
+
+>div : any
+
+ )}
+;
+>DropdownMenu : React.ComponentType
+
+ (
)}/> : JSX.Element
+>DropdownMenu : React.ComponentType
+
+ icon="move"
+>icon : string
+
+ label="Select a direction"
+>label : string
+
+ children={({ onClose }) => (
+>children : ({ onClose }: { onClose: () => void; }) => JSX.Element
+>({ onClose }) => (
) : ({ onClose }: { onClose: () => void; }) => JSX.Element
+>onClose : () => void
+>(
) : JSX.Element
+
+
+>
: JSX.Element
+>div : any
+
+
+>
: JSX.Element
+>button : any
+>onClick : () => void
+>onClose : () => void
+>button : any
+
+
+>div : any
+
+ )}
+/>;
+
diff --git a/tests/cases/compiler/contextuallyTypedJsxChildren.tsx b/tests/cases/compiler/contextuallyTypedJsxChildren.tsx
new file mode 100644
index 00000000000..bbc1e7ff3bf
--- /dev/null
+++ b/tests/cases/compiler/contextuallyTypedJsxChildren.tsx
@@ -0,0 +1,47 @@
+// @strict: true
+// @jsx: react
+// @esModuleInterop: true
+// @noEmit: true
+
+///
+
+import React from 'react';
+
+// repro from https://github.com/microsoft/TypeScript/issues/53941
+declare namespace DropdownMenu {
+ interface BaseProps {
+ icon: string;
+ label: string;
+ }
+ interface PropsWithChildren extends BaseProps {
+ children(props: { onClose: () => void }): JSX.Element;
+ controls?: never | undefined;
+ }
+ interface PropsWithControls extends BaseProps {
+ controls: Control[];
+ children?: never | undefined;
+ }
+ interface Control {
+ title: string;
+ }
+ type Props = PropsWithChildren | PropsWithControls;
+}
+declare const DropdownMenu: React.ComponentType;
+
+
+ {({ onClose }) => (
+
+
+
+ )}
+;
+
+ (
+
+
+
+ )}
+/>;