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

TSX: Stateless components error if one uses ref #6350

Closed
basarat opened this issue Jan 4, 2016 · 3 comments
Closed

TSX: Stateless components error if one uses ref #6350

basarat opened this issue Jan 4, 2016 · 3 comments
Labels
External Relates to another program, environment, or user action which we cannot control.

Comments

@basarat
Copy link
Contributor

basarat commented Jan 4, 2016

The following demonstrates this:

interface FooProps{}
const Foo = (props:FooProps) => <div/>;
const foo = <Foo ref="foo"/>; // Error : Property `ref` does not exists on type `IntrinsicAttributes & FooProps`

I have latest react.d.ts and typescript as of yesterday 🌹 /cc @RyanCavanaugh #5478

@RyanCavanaugh
Copy link
Member

This is a correct error. You'd get a runtime error if you rendered foo

@basarat
Copy link
Contributor Author

basarat commented Jan 5, 2016

Of course 🌹

@basarat basarat closed this as completed Jan 5, 2016
@RyanCavanaugh RyanCavanaugh added the External Relates to another program, environment, or user action which we cannot control. label Jan 5, 2016
@RyanCavanaugh
Copy link
Member

Ref http://codepen.io/anon/pen/WrRqWb in case anyone else lands here

@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
External Relates to another program, environment, or user action which we cannot control.
Projects
None yet
Development

No branches or pull requests

2 participants