-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Nested VirtualizedLists Warning in Flatlist with <Content> Tags #2947
Comments
Getting the exact same error. And removing the Content tag works for me. I guess your question gave me my answer. Those yellow box warnings are really annoying, anything to remove them. I just don't want to see them. |
Same here I'm using https://github.com/i6mi6/react-native-parallax-scroll-view |
I am also facing this issue by using KeyboardAwareScrollView (vertical) and FlatList (Horizontal) in the same page |
I am also getting this warning a lot. |
Good question. Default orientation for flex containers is column. Can't be having to change one's orientation to row. |
I am also experiencing this issue using ScrollViews, what should we do? |
+1 Experiencing the same thing. Just updated to the latest version of RN. |
+1 Not sure what they want me to replace this with. |
+1 |
My guessing is that it happens because you have a ScrollView inside another ScrollView. When I say scrollView I'm meaning ScrollView or FlatList |
I ended up using .map for all occasions, the warning went away not sure if it is ideal though. |
@yarapolana that is a very bad approach, if you have a list of 1000 items, they will all be rendered eating up a lot of your users data, using virtualized list AKA Flatlist i imagine in this case, you will be only rendering the items that fit on the screen, + 1 or 2 above or below. This ensures best practice for your end users. |
@Dellybro Yeah I know and you are right, I would not use for handling this amount of data for sure. .map worked for one case and added the ignoreWarning for the other cases until something comes to light. |
+1 here with the same trouble |
can you write this code in the Flatlist and create a function ex (_render_item) (ListHeaderComponent) |
That's correct. I was using a SectionList inside a ScrollView, but this is wrong, because SectionList is a ScrollView too, so I removed the ScrollView tag and SectionList did the work! |
This problem usually persist when we try to use Flatlist inside a ScrollView. In the previous version this wasnt a issue, but after 0.61 this issue has been seen.Is there any workaround for solving this?? |
FlatList should not be used inside a ScrollView with the same orientation, please paste your code here, maybe I can help you. |
@andrefangeloni Can you explain why I know this warning, but noone could really explain why. |
@djschilling Because FlatList do the same thing that ScrollView, it's redundant. Using only FlatList expected to resolve your problem. |
But what if I want to add some additional components outside of the FlatList and must scrollable, how can I do? |
I'm having the same problem |
I think this whole thing is happening because we are using |
+1 And this caused me the behavior of loading data crazy at the beginning of the interface. Currently I deleted Content to temporarily stop it. |
I have 3 FlatList inside Content... I only need to scroll the Content... |
If you aren't concerned with this warning and just want to ignore it (until it is fixed) just do this.
It will disable this warning for good. 👋 Remove it when fixed. EDIT Thanks for all the reactions! This means people care. To be clear this was just a workaround until the real issue was fixed, it was by no means a solution. |
Eu estava nesta mesma situação retirei o <ScroolView e ficou assim |
So, if this is discouraged, what would you suggest to use to build some UI where there are multiple FlatLists on one screen? Suppose the FlatLists are stacked vertically, and together overflow the screen (thus the parent screen must be a ScrollView of some sort, right?). |
I have a weird issue, in my case I have a component below the Now what happens is when I am stuck with my app release due to this, please guide me with a solution. |
Having this same issue where I use a |
As several people have already mentioned the warning is caused by the use of Personally, I love the "monkey patch" solution by @tspike
Would it be an idea to make this official and put a prop on I wouldn't mind putting in a PR for this if we can agree it's a decent solution. |
@dayanaohhnana answer worked very well for me `import React from 'react'; export default function VirtualizedView(props: any) { |
USAGE: |
|
I was able to get rid of that warning by adding one extra ScrollView layer in between the ScrollView and FlatList so they will never be on the same direction. Something like:
|
It's 2021 now, is anyone able to solved the issue, but not the hacky-way? i am using Flatlist inside Content also then annoying warning still appear. even latest version of nativeBase and react-native couldn't help. |
Have the same issue. |
facing same issue, i have:
how am i supposed to do? it's like a instagram friend's stories component |
hi @glinda93 thanks for the solution. In my case, your solution didn't worked but makes my view not scrollable. Here is my code structure: import {Container, Content} from 'native-base';
<Container>
<Header onScroll={onScroll} />
<ScrollView scrollEventThrottle={16} onScroll={handleScroll}>
<FlatList />
</ScrollView>
<BottomBar />
</Container> |
I have added ScrollView with many textinputs and also i created a custom dropdown component with flatlist. VirtualizedLists should never be nested inside plain ScrollViews with the same orientation - use another VirtualizedList-backed container instead |
^ changing the inner content of Picker component is not a solution to me, it should be usable inside a scrollview. changing from a Scrollview to a non-scrolling view isn't an option if there are other components on the screen or you want to support small screens. This is quite a messy thread.
ie. a super common use case is rendered impossible by this bug for example User is given some information after which they must choose something, then choose a location @bravemaster619 |
Categories `${item.id}`} />
Is from native-base it applicable to react native version 5.x |
It's really odd bug, I'd implemented ListItem using native base in different pages and it mess up my other ListItem styles if I use react FlatList, and I got the warning -> "VirtualizedLists should never be nested inside plain ScrollViews with the same orientation - use another VirtualizedList-backed container instead" so I end up implementing this way. import {FlatList, SafeAreaView, View} from 'react-native';
import {Text, Container, Body, ListItem, Left, Right} from 'native-base';
import {Icon} from 'react-native-elements';
const DATA = [
{
id: 'bd7acbea-c1b1-46c2-aed5-3ad53abb28ba',
title: 'First Item',
},
{
id: '3ac68afc-c605-48d3-a4f8-fbd91aa97f63',
title: 'Second Item',
},
{
id: '58694a0f-3da1-471f-bd96-145571e29d72',
title: 'Third Item',
},
];
function MyScreen({props}) {
return (
<SafeAreaView style={{flex: 1, backgroundColor: 'white'}}>
<Container // Important
style={{
marginTop: 10,
marginBottom: 10,
backgroundColor: 'blue',
}}>
<FlatList
data={DATA}
renderItem={({item}) => renderItem(item)}
keyExtractor={(item) => item.id}
/>
</Container>
</SafeAreaView>
);
function renderItem(item) {
return (
<View // Important
style={{
flex: 1,
}}>
<ListItem>
<Left>
<Icon name={'mail'} color={'black'} size={27} />
</Left>
<Body>
<Text style={{color: 'black'}}>{item.title}</Text>
</Body>
<Right>
<Icon
type={'material'}
name={'keyboard-arrow-right'}
color={'black'}
size={20}
/>
</Right>
</ListItem>
</View>
);
}
}
export default MyScreen; |
Thank you so much! It works for me. but I want to handle load more in the inner Flatlist and Pull to refresh. How can I do it? Thanks. |
Are there any current solutions? We need to use this... |
Its coming because of using ScrollView inside ScrollView , it can be FlatList . Replace the flatlist with map... Try this method , it worked for me !!!
|
There is a Dropdown inside the ScrollView. There is also ScrollView in Dropdown. The page scrolls when the user scrolls the Dropdown. Not all objects in Dropdown are visible. Warning: virtualizedlists should never be nested inside plain ScrollViews with the same orientation -use another VirtualizedList-backed container instead. We have entered the year 2022. Is there really no solution yet? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
If use react-native-dropdown-picker component, maybe that link help you for solution. Solved in my case. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
same problem... Just using this along with other components looks like a terrible crutch. |
any update on this virtualized list issue ... on how to have more than 1 flat list in wrapped inside a single scroll view of all same orientation |
The problem is in Picker.ios.js L 214 FlatList is in a Content which is a scrollable component, remove the content component in dist et it's ok NativeBase/src/basic/Picker.ios.js Line 214 in 182076c
|
Any update on this issue.I am using multiple flatlists inside of .Also I have other contents on the screen thats is why I am using |
still no update in 2024? this error still exist when we create a custom dropdown list and use it inside a ScrollView 🥴 |
Since upgrading RN to latest I am getting a warning:
"VirtualizedLists should never be nested inside plain ScrollViews with the same orientation - use another VirtualizedList-backed container instead"
This error is being caused by the tag around a flatlist which worked perfectly fine before the latest upgrades.
RN: 61.1
Native Base: 2.13.8
React: 16.9.0
React Navigation: 4.0.9
This warning comes up on every flatlist as I use Content tag around my flatlist. This only started yesterday as I upgraded to latest RN from 60, and native base 2.13.8. I can remove the error by removing the Content tag.
Thoughts?
The text was updated successfully, but these errors were encountered: