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

RenderItem not triggering when totalCount is not changing but data is #90

Closed
toonvd opened this issue Apr 7, 2020 · 2 comments
Closed
Labels
enhancement New feature or request PR welcome You can give that a try :)

Comments

@toonvd
Copy link
Contributor

toonvd commented Apr 7, 2020

Hi

When having new data but the same totalCount, item generation is not triggering.
Is there a way to force the trigger?

If you open up the console https://stackblitz.com/edit/react-vrcu3a?file=example.js you can see the problem.

@toonvd toonvd changed the title RenderItem not triggering RenderItem not triggering when totalCount is not changing but data is Apr 7, 2020
@toonvd
Copy link
Contributor Author

toonvd commented Apr 7, 2020

Hi

This can also be fixed by using computeItemKey, so it keeps rerendering to change the key.

@toonvd toonvd closed this as completed Apr 7, 2020
@petyosi
Copy link
Owner

petyosi commented Apr 8, 2020

Another way to fix this (and an easy one) would be to introduce a new property called data-key - changing its value to something like Symbol() can be used to re-render the list.

@petyosi petyosi added enhancement New feature or request PR welcome You can give that a try :) labels Apr 8, 2020
@petyosi petyosi reopened this Apr 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request PR welcome You can give that a try :)
Projects
None yet
Development

No branches or pull requests

2 participants