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

refs do not work in renderRow functions #1677

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

refs do not work in renderRow functions #1677

jamiefaye opened this issue Jun 18, 2015 · 2 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@jamiefaye
Copy link

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
Copy link
Contributor

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
Copy link
Author

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.

@facebook facebook locked as resolved and limited conversation to collaborators Jun 18, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 22, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

3 participants