-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Unhelpful error with StatelessComponents #10170
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
Comments
"React.StatelessComponent" aren't you supposed to inherit from it? I didn't take a look now but that is what a gathered from my last read of the release notes 🌹 |
Ah, maybe I've misunderstood the way it's mean to be used, I was going based on this blog post and the definition of the interface StatelessComponent<P> {
(props?: P, context?: any): ReactElement<any>;
propTypes?: ValidationMap<P>;
contextTypes?: ValidationMap<any>;
defaultProps?: P;
displayName?: string;
} Which looks to me like it's a function which returns a |
Irrespective of the potential "misuse" you have encountered a |
My misunderstanding. The new thing I was thinking is a new "class" called React.PureComponent 🌹 |
Looks like a duplicate of #7286, which has been fixed in 2.0 |
TypeScript Version: 1.8.10
Code
File:
src/App.tsx
File:
Child.tsx
File:
tsconfig.json
Expected behavior:
An error free compile
Actual behavior:
I imagine I'm doing something wrong here but I can't figure out what it is because the error message is a little obtuse.
There's a repo demoing the whole problem here: https://github.com/alexjg/typescript-error-demo
Thanks
The text was updated successfully, but these errors were encountered: