VirtualizedLists should never be nested inside plain ScrollViews React Native - react-native

hi i'm getting this error i don't know how to fix it
error type : "VirtualizedLists should never be nested inside plain
ScrollViews with the same orientation because it can
break windowing and other functionality - use another
VirtualizedList-backed container instead."
my code
return (
<View style={{flex: 1}}>


VirtualizedLists should never be nested inside plain ScrollViews by using react native SearchableDropdown

How to use scrollview over package like react-native-autocomplete-input? Basically I have a form in my react native package in which there are multiple input fields including autocomplete so I need a scroll over my screen so how should I achieve that?My code looks like that
<TextInput />
<SearchableDropdown />
<TextInput />
<Picker />
It gives me that error
VirtualizedLists should never be nested inside plain ScrollViews with the same orientation because it can break windowing and other functionality

TouchableHighlight not working although using the source code from official react native documentation

I'm a new react native developer and I have an issue with TouchableHighlight where it always shows an error "Error: React.Children.only expected to receive a single React element child." in addition while I remove it is work as usual and I assume if this issue come from my device/vscode/browser. Because I already follow the source code from but still show that error.
Error image
Image without TouchableHighlight tag
Here my code
render() {
return (
<View style={styles.container}>
<TouchableHighlight onPress={this.onPress}>
<View style={styles.button}>
<Text>Touch Here</Text>
<View style={[styles.countContainer]}>
<Text style={[styles.countText]}>
{this.state.count ? this.state.count : null}
From the error message, the issue might happen if you pass Mutlipe child components to TouchableHighlight
From the docs:
TouchableHighlight must have one child (not zero or more than one). If you wish to have several child components, wrap them in a View
<TouchableHighlight onPress={onPress}>
<View style={styles.button}> // Mutlipe child components are wrapped in a View
<Text>Touch</Text> // component 1
<Text>Here</Text> // component 2

React Native Base Picker displaying Warning : VirtualizedLists should never be nested inside plain ScrollViews

I'm using Native base's Picker component and rendering using .map:
Tried everything the Internet has suggested!! Didn't get it fixed yet
<Item rounded style={{marginBottom:20}}>
<Picker selectedValue={this.state.district} onValueChange={(val)=>this.setDistrict(val)}>
<Picker.Item label='Select District' value='0'/>
{,index) => {
return (<Picker.Item label={} value={} key={index+1}/>) //if you have a bunch of keys value pair
Experiencing the same thing!
You can use like this:
<SafeAreaView> Your code block </SafeAreaView>

How to fix this warning: VirtualizedLists should never be nested inside plain ScrollViews with the same orientation

When I use FlatList component inside ScrollView I see a warning:
VirtualizedLists should never be nested inside plain ScrollViews with the same orientation - use another VirtualizedList-backed container instead.
Before and after FlatList I use a lot of other components and my screen is long.
I tried to wrap content with SafeAreaView and it doesn't help me, because in this case I can't scroll the content. I also tried to use ListHeaderComponent={SafeAreaView} and ListFooterComponent={SafeAreaView} in <FlatList>.
I use:
"react": "16.9.0",
"react-native": "0.61.5",
Here is a VirutalizedList -backed container implementation using FlatList:
import React from 'react';
import { FlatList } from 'react-native';
export default function VirtualizedView(props: any) {
return (
keyExtractor={() => "dummy"}
ListHeaderComponent={() => (
<Text>Anything goes here, even FlatList works good</Text>
<View style={{minHeight: 480}}> // leave enough space for better user experience
renderItem={({item}) => <Item data={item} />}
This will show scrollbar when your screen is too long and also remove the pesky warning message and performance will be saved without any problem.
There is a simpler solution using
This is only required for Android (iOS works as expected even without it).
Just make sure to enable this prop in both parent and child ScrollViews (or child FlatLists).
What I've done in my case is something along the lines of this:
render() {
return (
<SafeAreaView style={{ flex: 1 }}>
scrollEnabled={false} // this line is important
It doesn't remove the warning, but it does work as I want it to, as I need a ScrollView and a FlatList.

React Native "keyboardDismissMode" at FlatList

Is there any possibility to prevent the keyboard from dismissing when scrolling a FlatList?
When using a ScrollView setting the prop "keyboardDismissMode" to "none" is the solution to this problem, but this doesn't work for me at a FlatList...
I use the FlatList inside a self-made component, that is in a Stack-Navigator, while there is a focussed TextInput in its header. I render the FlatList like this:
<View style={{flex: 1}}>
style={{flex: 1}}
keyExtractor={(item, index) =>}
The renderItem() function:
renderItem = ({item, index}) => (
style={{paddingVertical: 10}}
onPress={() => {
<Text numberOfLines={1} >
The docs at the beginning of the reference section says that FlatList "Inherits ScrollView Props, unless it is nested in another FlatList of same orientation."
So I think you can just do use that keyboardDismissMode without encapsulation in a scrollview.
No need of scrollview inside flatlist it will create performance issue.
just add onScrollBeginDrag={Keyboard.dismiss} in flatlist. it will work in android as well iOS while keyboardDismissMode='on-drag' will work only in iOS
You might think about to encapsulate your FlatList in a ScrollView?
Even if this seems to solve the issue, it's NOT a recommended way!
That's because if it force rerendering the whole flatlist, each time you scroll the screen.
You might better try a component like react-native-keyboard-aware-scroll-view
I've found this article with some alternate Ideas to fix it:
How to use KeyboardAvoidingView with FlatList?