Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type checking embedded expressions in tsx #14577

Closed
ceymard opened this issue Mar 10, 2017 · 1 comment
Closed

Type checking embedded expressions in tsx #14577

ceymard opened this issue Mar 10, 2017 · 1 comment
Labels
Duplicate An existing issue was already created

Comments

@ceymard
Copy link

ceymard commented Mar 10, 2017

It would seem that typescript treats anything between curly braces in tsx expressions as any.

There is no option on the JSX namespace that I know of that allows restricting the result of expressions to certain types.

TypeScript Version: 2.2.1

Code

var div = <div>
  {new Date()}
</div>

This always compiles. How do I prevent certain types from being validated there ? Should there be a modification of the JSX namespace ?

@RyanCavanaugh
Copy link
Member

Duplicate #13618

@RyanCavanaugh RyanCavanaugh added the Duplicate An existing issue was already created label Mar 10, 2017
@mhegazy mhegazy closed this as completed Apr 21, 2017
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

3 participants