Closed as not planned
Closed as not planned
Description
π Search Terms
Inference
π Version & Regression Information
- This changed between versions 5.5.4 and 5.6.0-beta (still happening in 5.6.1-rc)
β― Playground Link
π» Code
type FunctionComponent<P = any> = (props: P) => Element | null;
interface ElementAttributes {
idomKey?: string | null | number;
children?: unknown;
skip?: boolean;
}
declare function element<P>(
tag: FunctionComponent<P & ElementAttributes>,
attributes: P & ElementAttributes,
): Element;
declare function ElName(props: {name?: string}): Element;
element(ElName, {});
// Does not compile in 5.6. Should compile.
π Actual behavior
Last line errors with:
Argument of type '(props: { name?: string | undefined; }) => Element' is not assignable to parameter of type 'FunctionComponent<ElementAttributes>'.
Types of parameters 'props' and 'props' are incompatible.
Type 'ElementAttributes' has no properties in common with type '{ name?: string | undefined; }'.(2345)
π Expected behavior
Compiles as it did in previous versions
Additional information about the issue
Confirmed that #59709 does not resolve this issue.
(Google note: relevant source location http://shortn/_Ce1E5yV592)