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

blank area always showing on each scroll #796

Closed
1 of 2 tasks
hotaryuzaki opened this issue Mar 21, 2023 · 6 comments
Closed
1 of 2 tasks

blank area always showing on each scroll #796

hotaryuzaki opened this issue Mar 21, 2023 · 6 comments
Labels
bug Something isn't working

Comments

@hotaryuzaki
Copy link

hotaryuzaki commented Mar 21, 2023

Current behavior

i create an Explore page like Instagram, but with the same size for all images.
the issue is similar with this, but it is worse if the list contains an image.
if i change to flatlist, there is no more blank area but less performance

is it possible because of the Key props?
the problem is that when i remove the key props, the image order changes.

Expected behavior

"No more blank cells" as advertised

To Reproduce

just using this code

  const renderItem = useCallback(({ index, item }) => {
    const checkedIndex = imageChecked.findIndex((checkedItem) => checkedItem.id == item.id);

    return (
      <RenderItem
        key={`${index}-${item.id}`}
        index={index}
        item={item}
        onPress={_onPressCheckbox}
        selectedAlbum={selectedAlbum}
        checkedIndex={checkedIndex != -1 ? true : false}
      />
    );

  }, [photos, imageChecked]);

              <FlashList
                numColumns={3}
                data={photos}
                extraData={imageChecked}
                renderItem={renderItem}
                ListFooterComponent={renderFlatListFooter}
                estimatedItemSize={200}
                onEndReached={_handleLoadMore}
                onEndReachedThreshold={0.3}
                onMomentumScrollBegin={() => onEndReachedCalledDuringMomentum = false}
                drawDistance={Layout.window.height * 5}
              />

Platform:

  • iOS
  • Android

Environment

System:
OS: Linux 5.15 Ubuntu 20.04.6 LTS (Focal Fossa)
CPU: (4) x64 Intel(R) Core(TM) i7-5500U CPU @ 2.40GHz
Memory: 5.70 GB / 15.55 GB
Shell: 5.0.17 - /bin/bash
Binaries:
Node: 16.13.2 - ~/.nvm/versions/node/v16.13.2/bin/node
Yarn: 1.22.19 - ~/.nvm/versions/node/v16.13.2/bin/yarn
npm: 8.1.2 - ~/.nvm/versions/node/v16.13.2/bin/npm
Watchman: 20220123.190932.0 - /usr/local/bin/watchman
SDKs:
Android SDK: Not Found
IDEs:
Android Studio: Not Found
Languages:
Java: 11.0.18 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 18.1.0 => 18.1.0
react-native: ^0.70.7 => 0.70.7
npmGlobalPackages:
react-native: Not Found

@hotaryuzaki hotaryuzaki added the bug Something isn't working label Mar 21, 2023
@fortmarek
Copy link
Contributor

Refer to the docs. For example, you shouldn't include a key in your component.

@mickdewald
Copy link

But when I remove the key, the sort order changes during scroll.
When I scroll down and the back-up, suddenly the items have been rearranged

@hotaryuzaki
Copy link
Author

But when I remove the key, the sort order changes during scroll. When I scroll down and the back-up, suddenly the items have been rearranged

Yes we have same issue like I stated above, if we remove the key the images rearranged

@mohamed2m2018
Copy link

Have the same issue

@vishal-nayak07
Copy link

vishal-nayak07 commented Dec 18, 2023

Facing the same issue. i am using @shopify/flash-list version 1.5.0 in my react native app.

#854 (comment)

@dippathak1912
Copy link

Have the same issue.

"@shopify/flash-list": "^1.5.0",
"react-native": "^0.70.1",
"react": "18.1.0"

Is there any way out of this? Issue is closed but still facing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants