I have this scenario where I need to use a flatlist within a scrollview but react native keeps on showing a warning which says, virtualizedLists should never be nested. So I resorted to keep the scrollview as a wrapper and use a view with a scrolling functionality(if possible). Anyone have any idea how to achieve such thing without using any 3rd party packages? Thanks in advance!
I have this problem in some of my apps.
One could restructure the code and add the components above and below the FlatList as header or footer components (ListHeaderComponent & ListFooterComponent).
Or one could simply tell React Native to ignore the error messages :P
I have not yet found a real problem that has occurred because I ignored the warning. But be aware as it is unsupported the behavior might change in the future.
If you want to ignore "VirtualizedLists should never be nested" error messages. You just have to add the code below in your App.tsx:
import { LogBox } from "react-native";
useEffect(() => {
LogBox.ignoreLogs(["VirtualizedLists should never be nested"]);
});