FlatList is no more scrollable with action sheet .
I followed documentation in which it suggest to import FlatList from action sheet package but when i load data of more than 100 users it crashes .
pls anyone who sol. share it.....
FlatList is no more scrollable with action sheet .
I followed documentation in which it suggest to import FlatList from action sheet package but when i load data of more than 100 users it crashes .
pls anyone who sol. share it.....
Copyright © 2021 Jogjafile Inc.
Your question is missing a lot of context, so I'll have to make a few assumptions to provide you with an answer. I see you're new here, so here is a post about how to ask a good question. This will make you get good answers more quickly and more often.
Lets continue: first of, I'm not sure what loading data from 100 users means exactly on your context, nor do I know the kind of information you're trying to show on the
Action Sheet, but I'll be assuming that loading the users data is not what is causing the crash.Reconsider your approach
To be honest, I would never add so many itens inside an
ActionSheet, even if it didn't crash. Here's why:Even though from the developer standpoint it might seem like it achieves the goal of presenting every option to the user, it's really bad from a user experience standpoint:
Action sheets don't usually take the whole screen, so the user doesn't have much space to scroll through and read all the options;
Action sheets don't usually have search fields, so the user is locked in a small portion of the screen (1) trying to find one option among a hundred.
This is the kind of experience that makes users give up using your app.
What I would do instead
You could you use the
Modalcomponent to create a component that will overlap your screen whilevisible=true, and inside such modal you could render a normalFlatList(imported fromreact-native). Also, for so many rows, you could also add aTextInputto thatModal, where the user could filter the results based on some text value.(If you have trouble handling the input inside the modal, you can try
KeyboardAvoidingView)This will make the user experience much better and you most likely won't be facing this crash issue.
Hope this helps!