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

[ListView] Update curRenderedRowsCount when data source changes #1612

Closed
wants to merge 1 commit into from

Conversation

ide
Copy link
Contributor

@ide ide commented Jun 13, 2015

When a new data source is provided, update curRenderedRowsCount in addition to prevRenderedRowsCount. What was happening is that I had an empty data source, so curRenderedRowsCount and prevRenderedRowsCount both settled at zero after the first few frames and curRenderedRowsCount wasn't getting increased when the data source was updated.

I also changed the setState calls to use the transactional API since several of the new state values are computed from the old ones.

Maybe fixes #1547

When a new data source is provided, update `curRenderedRowsCount` in addition to `prevRenderedRowsCount`. What was happening is that I had an empty data source, so `curRenderedRowsCount` and `prevRenderedRowsCount` both settled at zero after the first few frames and `curRenderedRowsCount` wasn't getting increased when the data source was updated.

I also changed the `setState` calls to use the transactional API since several of the new state values are computed from the old ones.
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jun 13, 2015
@ide ide closed this in 3393b86 Jun 16, 2015
@ide ide deleted the listview-rerender branch June 25, 2015 18:09
Fanghao pushed a commit to discord/react-native that referenced this pull request Jul 22, 2015
Summary:
When a new data source is provided, update `curRenderedRowsCount` in addition to `prevRenderedRowsCount`. What was happening is that I had an empty data source, so `curRenderedRowsCount` and `prevRenderedRowsCount` both settled at zero after the first few frames and `curRenderedRowsCount` wasn't getting increased when the data source was updated.

I also changed the `setState` calls to use the transactional API since several of the new state values are computed from the old ones.

Maybe fixes facebook#1547
Closes facebook#1612
Github Author: James Ide <ide@jameside.com>

Test Plan: Imported from GitHub, without a `Test Plan:` line.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ListView] broken without setInterval
3 participants