Repository: TypeScript
Issue: Properties detectable as excess due to missing discriminant should be flagged in JSX expressions
Labels: Bug,Domain: JSX/TSX

# Bug Report

When using TSX syntax to create a element which props are typed as a discriminated union, validation works when given element is constructed in TSX syntax without children, but loses validation once you add children.
<!--
  Please fill in each section completely. Thank you!
-->

### 🔎 Search Terms
react createElement validation tsx jsx children throws 

<!--
  What search terms did you use when trying to find an existing bug report?
  List them here so people in the future can find this one more easily.
-->

### 🕗 Version & Regression Information

<!-- When did you start seeing this bug occur?

"Bugs" that have existed in TS for a long time are very likely to be FAQs; refer to
  https://github.com/Microsoft/TypeScript/wiki/FAQ#common-bugs-that-arent-bugs

If possible, please try testing the nightly version of TS to see if it's already been fixed.
For npm: `typescript@next`
This is also the 'Nightly' version in the playground: http://www.typescriptlang.org/play/?ts=Nightly

Note: The TypeScript Playground can be used to try older versions of TypeScript.

Please keep and fill in the line that best applies:
-->

- This is the behavior in every version I tried (3.x - 4.3.0-beta)

### ⏯ Playground Link


<!--
  A link to a TypeScript Playground "Share" link which shows this behavior

  The TypeScript Workbench can be used for more complex setups, try
  https://www.typescriptlang.org/dev/bug-workbench/

  As a last resort, you can link to a repo, but these will be slower for us to investigate.
-->
[Playground link with relevant code](https://www.typescriptlang.org/play?ssl=57&ssc=1&pln=56&pc=2#code/JYWwDg9gTgLgBDAnmApnA3nA0ixAaOAJRQEMBjGAOQgBM0BfOAMyghDgCIpSKOAoUJFhwAVHBIBnIj3gs2nbuRj8BAOxgooTcmgDKwVQHMANil0pTFAAqswU9HzhwJFlBRQ0ciAPwAubLiOcHTaAK7GMOaWGp64fgGIQRCqUW4xXgDCABYkRijxABQA1rj+XgCUcAC8AHxwAG4QwDR89HxqGlo6cACy4TDAYKap1rb2QS7RHl4S8eYwADxeNUEhJP0j6biz-vNLuCtOyZvTuNm5hvn+xdu7KIvLlbUNTS1tfEiocJsAqqrAyWqQQAPnACpgQP1BqZ-DAoKEGHAAGS9KFDMyuUYQOzlEFgiFo0zxbTGFxwRgo-RGYa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sUcEHHz0JwD22Z6DMDg5DDfS5XHtNfAAAabOBxzhNeiT+ZkyPkf03Ague-bO+DkHeOmMHROnVzeY8-z58rEAA)

### 💻 Code

<!-- Please post the relevant code sample here as well-->
```tsx
// this one should error but does not because it has children (tsx syntax)
const B = (
  <Accordion defaultSelectedKeys={new Set()}>
    <span>1</span>
  </Accordion>
)
// while using createElement it does error (like it should)
React.createElement(Accordion, {defaultSelectedKeys:new Set<Key>()}, <span>1</span>)
// while these also error (like they should) because they are without children.
const X = <Accordion defaultSelectedKeys={new Set()} />
const Y = <Accordion multiple defaultSelectedKey="1" />

```

### 🙁 Actual behavior

Like shown above, while `React.createElement` throws like it should, using TSX syntax though, it stops working.

### 🙂 Expected behavior

Same behavior as with `createElement` - raise a validation error with children