* Bring jsx type resolution inline with normal objects, move jsx attribute property ignorign into relationship check * Improved errors and reordered members * Always use inferrential mode for jsx pass * Add some missing skipLibChecks * New check mode instead of odd type mapper * Do not enable object literal freshness checks on jsx spreads * Fix minor style nits * Update order of type for test * Accept corrected baseline
20 lines
518 B
TypeScript
20 lines
518 B
TypeScript
// @jsx: react
|
|
// @libFiles: lib.d.ts,react.d.ts
|
|
// @skipLibCheck: true
|
|
// @allowSyntheticDefaultImports: true
|
|
import React from "react";
|
|
|
|
type InfoProps =
|
|
| { status: "hidden" }
|
|
| { status: "visible"; content: string };
|
|
|
|
const Info = (props: InfoProps) =>
|
|
props.status === "hidden"
|
|
? <noscript />
|
|
: <div>{props.content}</div>;
|
|
|
|
const a = <Info status="hidden" />;
|
|
const b = <Info status="visible" content="hello world" />;
|
|
declare const infoProps: InfoProps;
|
|
|
|
const c = <Info {...infoProps} />; |