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

Store references to nodes that use the "ref" attribute #154

Closed
mairatma opened this issue Aug 31, 2016 · 1 comment
Closed

Store references to nodes that use the "ref" attribute #154

mairatma opened this issue Aug 31, 2016 · 1 comment
Assignees

Comments

@mairatma
Copy link
Contributor

This is a feature that has been requested before. It's basically to allow using ref inside regular dom elements, instead of only for component instances. If a ref is given to an element, its reference should be stored in the refs variable of the owner component. For example:

// Can be accessed as "this.refs.myElement"
<div ref="myElement"></div>

Note that component instances should still be accessible inside this.components like before (for backwards compatibility), but not element instances (since they're not components). Both should be accessible via this.refs. In a future major version we can get rid of this.components (since it covers only one of the use cases due to the name being too specific).

@mairatma mairatma self-assigned this Aug 31, 2016
@mairatma
Copy link
Contributor Author

This has been added in f8ee3b9.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant