-
Notifications
You must be signed in to change notification settings - Fork 73
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
State is forgotten when item is re-rendered #13
Comments
Probably. The list view works by destroying views after they've scrolled off screen, so state would probably have to be persisted for items like radio buttons. |
its works fine i.e state or props does not revert back in Android, but in IOS state or props values does get revert back. |
I could perhaps add a Let me know how helpful that'd be |
Maybe |
In many case state should be replaced by props anyways. I wonder if supporting this case, is worth it and if the same effect cannot be achieve by developers rewriting their code to depend more on props (good) in stead of state (bad). |
@mschipperheyn - fair point |
I have a list of radio buttons, each can be toggled by tapping. When I toggle a radio button, scroll away and scroll back to it, the radio button resets to the original state. Is this intentional?
EDIT: The radio button's
getInitialState
sets its toggled state to be on. I'm guessing that when an item leaves the current viewport, it gets destroyed completely and then re-drawn when it comes back into view. Therefore, the item is re-rendered completelygetInitialState
gets called again.The text was updated successfully, but these errors were encountered: