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

refs do not work in renderRow functions #1677

Closed
jamiefaye opened this Issue Jun 18, 2015 · 2 comments

Comments

Projects
None yet
3 participants
@jamiefaye

jamiefaye commented Jun 18, 2015

ref='name' attributes generated inside of functions called via the renderRow property of ListViews do not work. Using this.refs.name returns undefined. This makes coding renderRow functions more difficult. Is this supposed to be this way?

#897 addresses this problem, however I have not been able to get any of the suggestions to work. In particular, attempts to use the ref={(row, sec, i) => ...
approach fail with complaints about writing to read-only properties.

How should I refer to one object from another inside a renderRow function?

I do have an example of this not working I can share if need be.

@ide

This comment has been minimized.

Show comment
Hide comment
@ide

ide Jun 18, 2015

Collaborator

Can you paste a gist with your code? The callback-style ref should work. String-style refs won't work because they're assigned to the owner component that renders them which probably ends up being ListView and not your own component.

Collaborator

ide commented Jun 18, 2015

Can you paste a gist with your code? The callback-style ref should work. String-style refs won't work because they're assigned to the owner component that renders them which probably ends up being ListView and not your own component.

@jamiefaye

This comment has been minimized.

Show comment
Hide comment
@jamiefaye

jamiefaye Jun 18, 2015

I encountered the issue with the callback-style ref back on 0.4.4 and was able to get the callback working in 0,6.0-rc. It may well have been programmer error back then.

If the issue comes back, we can reopen this.

jamiefaye commented Jun 18, 2015

I encountered the issue with the callback-style ref back on 0.4.4 and was able to get the callback working in 0,6.0-rc. It may well have been programmer error back then.

If the issue comes back, we can reopen this.

@jamiefaye jamiefaye closed this Jun 18, 2015

@facebook facebook locked as resolved and limited conversation to collaborators Jun 18, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.