Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,8 @@ function isTypeJSXElementLike(type: ts.Type, project: TypeScriptProject): boolea
if (symbol) {
const name = project.checker.getFullyQualifiedName(symbol);
return (
// Remove once global JSX namespace is no longer used by React
name === 'global.JSX.Element' ||
name === 'React.JSX.Element' ||
name === 'React.ReactElement' ||
name === 'React.ReactNode'
// Some types are resolved to paths like: "/Users/.../node_modules/@types/react/jsx-runtime".JSX.Element
name.endsWith('.JSX.Element') || name.endsWith('.ReactElement') || name.endsWith('.ReactNode')
);
}

Expand Down
7 changes: 2 additions & 5 deletions packages-internal/docs-utils/src/getPropsFromComponentNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,8 @@ function isTypeJSXElementLike(type: ts.Type, project: TypeScriptProject): boolea
if (symbol) {
const name = project.checker.getFullyQualifiedName(symbol);
return (
// Remove once global JSX namespace is no longer used by React
name === 'global.JSX.Element' ||
name === 'React.JSX.Element' ||
name === 'React.ReactElement' ||
name === 'React.ReactNode'
// Some types are resolved to paths like: "/Users/.../node_modules/@types/react/jsx-runtime".JSX.Element
name.endsWith('.JSX.Element') || name.endsWith('.ReactElement') || name.endsWith('.ReactNode')
);
}

Expand Down
Loading