diff --git a/types.d.ts b/types.d.ts index 498bb694de2e6a62f14d3fe998dc538aff920fc6..ab288cdf8ca228fc8daaff2c5fb84ce665b40812 100644 --- a/types.d.ts +++ b/types.d.ts @@ -5,7 +5,7 @@ */ // @ts-ignore JSX runtimes may optionally define JSX.ElementType. The MDX types need to work regardless whether this is // defined or not. -type ElementType = any extends JSX.ElementType ? never : JSX.ElementType; +type ElementType = any extends React.JSX.ElementType ? never : React.JSX.ElementType; /** * This matches any function component types that ar part of `ElementType`. @@ -20,12 +20,12 @@ type ClassElementType = Extract) => /** * A valid JSX string component. */ -type StringComponent = Extract; +type StringComponent = Extract; /** * A JSX element returned by MDX content. */ -export type Element = JSX.Element; +export type Element = React.JSX.Element; /** * A valid JSX function component. @@ -44,7 +44,7 @@ type FunctionComponent = ElementType extends never */ type ClassComponent = ElementType extends never // If JSX.ElementType isn’t defined, the valid return type is a constructor that returns JSX.ElementClass - ? new(props: Props) => JSX.ElementClass + ? new(props: Props) => React.JSX.ElementClass : ClassElementType extends never // If JSX.ElementType is defined, but doesn’t allow constructors, function components are disallowed. ? never @@ -70,7 +70,7 @@ interface NestedMDXComponents { export type MDXComponents = & NestedMDXComponents & { - [Key in StringComponent]?: Component; + [Key in StringComponent]?: Component; } & { /**