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

does not have any construct or call signatures. #10556

Closed
moaead opened this issue Aug 26, 2016 · 4 comments
Closed

does not have any construct or call signatures. #10556

moaead opened this issue Aug 26, 2016 · 4 comments
Labels
Duplicate An existing issue was already created

Comments

@moaead
Copy link

moaead commented Aug 26, 2016

TypeScript Version: 1.8.0 / nightly (2.0.0-dev.201xxxxx)

Code

var ElementType = "a";
<ElementType className={className} style={this.props.style}/>

Expected behavior:

create an element with <a>, this is valid on jsx.

Actual behavior:

error TS2604: JSX element type 'ElementType' does not have any construct or call signatures.

Workaround

React.createElement(ElementType, {className: className, style: this.props.style});
@RyanCavanaugh RyanCavanaugh added the Duplicate An existing issue was already created label Aug 26, 2016
@RyanCavanaugh
Copy link
Member

Duplicate of #8549

@moaead
Copy link
Author

moaead commented Aug 26, 2016

@RyanCavanaugh thanks for the response, so this should work on typescript 2 beta right?
because i updated to 2 beta and still getting issues

@RyanCavanaugh
Copy link
Member

Works fine for me in the latest from master. I don't think the fix was in the Beta build.

@moaead
Copy link
Author

moaead commented Aug 26, 2016

thanks again, trying on nighty build. this should work correct?

const Abc = "i";
return (
     <Abc className={className} style={this.props.style}/>
);

edit: all worked good, thanks

@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

2 participants