Bug Report
๐ Search Terms
jsx, infer property
๐ Version & Regression Information
- This is the behavior in every version I tried, and I reviewed the FAQ for entries about JSX
โฏ Playground Link
import React from 'react'
declare function A(props: {
children:
| React.ReactElement<{ test: 'aaaa' | 'bbbb' }>
}): React.ReactElement
declare function B<P extends Record<string, any>>(props: ...
Playground Link
๐ป Code
import React from 'react'
declare function A(props: {
children:
| React.ReactElement<{ test: 'aaaa' | 'bbbb' }>
}): React.ReactElement
declare function B<P extends Record<string, any>>(props: P): React.ReactElement<P>
const C = <A>
<B test={'a'} />
// ^? (property) test: string
{B({
test: 'aaaa'
// ^? (property) test: 'aaaa'
})}
</A>
๐ Actual behavior
Infer test property is string type in JSX.
๐ Expected behavior
Infer test property is 'aaaa' type in JSX.
Bug Report
๐ Search Terms
jsx, infer property
๐ Version & Regression Information
โฏ Playground Link
Playground Link
๐ป Code
๐ Actual behavior
Infer test property is
stringtype in JSX.๐ Expected behavior
Infer test property is
'aaaa'type in JSX.