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

Force rerendering when data changes #52

Closed
AbdallaElabd opened this issue Oct 16, 2017 · 9 comments
Closed

Force rerendering when data changes #52

AbdallaElabd opened this issue Oct 16, 2017 · 9 comments

Comments

@AbdallaElabd
Copy link

I have a case where some data in my Redux store is being updated, and I want the RecyclerListView to update its rows. Currently, if the row has been rendered it's not updated until I scroll far away and then scroll back. Is there a method that I can call to imperatively rerender the visible rows?

@naqvitalha
Copy link
Collaborator

rowHasChanged passed to DataProvider is for the same purpose. Any issues there?

@AbdallaElabd
Copy link
Author

It doesn't run the render function of the row I'm afraid. And I've even changed the row has changed to use lodash's deep equality check, but with no luck.

@naqvitalha
Copy link
Collaborator

We've built multiple features where row data has changed and haven't any faced issues. This is basic functionality. Can you provide a quick repro on snack so that we can help you out?

@naqvitalha
Copy link
Collaborator

Reopen is issue still remains. As long as you have relevant checks in rowHasChanged this is a non issue.

@AbdallaElabd
Copy link
Author

I'll try to isolate the problem and let you know. Thanks for following up.

@naqvitalha
Copy link
Collaborator

naqvitalha commented Dec 2, 2017

Check extendedState prop in v1.2.2.

@Timer00
Copy link

Timer00 commented Jul 11, 2018

We had a pretty similar problem, the page would not update until you went further on the magazine and then came back.
By passing our state to extendedState the problem was fixed, now it re renders properly!
extendedState={this.state}

@samuely4ng
Copy link

Check extendedState prop in v1.2.2.

thank you so much! I've been looking for this for a solid day

@sayo96
Copy link

sayo96 commented Jan 19, 2022

None of the above solutions work for me.
Here is my problem:

  1. I use Recycler list for displaying a list of items (say 1,2,3,4,5)
  2. When user deletes an item (say 1) i'm updating the dataProvider which is in local state. DataProvider in local state acts as the source for recycler list view
  3. Even after the state changes the view remains the same. In my case even after the user deletes 1 and the latest values in state are (2,3,4,5) but the all the 5 items are still displayed.

The recycler list view has the correct changes (ie 2,3,4,5) when i navigate to a different section of the app and come back though.

RowhasChanged /extended state solutions as suggested above don't work for me. Please help 🙏

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

No branches or pull requests

5 participants