-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[TS] StyledComponentClass does not have any construct or call signatures #1079
Comments
Sorry, my bad. I forgot to install |
Thank for documenting, had same issue. :) |
Even with {
"dependencies": {
"react": "16.4.1",
"react-native": "0.56.0",
"styled-components": "^3.4.1"
},
"devDependencies": {
"@types/jest": "^23.3.1",
"@types/react": "^16.4.9",
"@types/react-native": "^0.56.6",
"@types/react-navigation": "^2.0.13",
"@types/react-test-renderer": "^16.0.2",
"babel-jest": "23.4.2",
"babel-preset-react-native": "^5",
"jest": "23.4.2",
"react-addons-test-utils": "^15.6.2",
"react-dom": "^16.4.2",
"react-native-typescript-transformer": "^1.2.10",
"react-test-renderer": "16.4.1",
"ts-jest": "^23.1.3",
"typescript": "^3.0.1"
}
} |
After much playing about I noticed that you have to enable Typescript support on VSCode. I had a fresh install of VSCode and after installing/enabling full support the Typingscript it worked. Just click Typescript on the welcome screen and reload your editor. It's funny cause Typescript syntax works out the box for VSCode, but only after I do this does it begin to work 🤔 Thanks again team. ❤️💅 |
Hello. I'm trying to up a new project with typescript + styled-components, but I faced with a problem with prop types + jsx.
I get this error:
[ts] JSX element type 'Styled' does not have any construct or call signatures
when I try to use a Component from styled.Styled
type isStyledComponentClass<Props, any, Props>
by inference as specified in styled typings.But if I force the type as
any
it works 'normally', without error:But this way I'll loss all the typing benefit, I think.
I tried put
StatelessComponent<Props>
instead of any, but unsuccessfully (I don't know why, I'm new with TS)How can I get around this situation?
The text was updated successfully, but these errors were encountered: