Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

1.6K
Views
React-Native another VirtualizedList-backed container

After upgrading to react-native 0.61 i get a lot of warnings like that:

VirtualizedLists should never be nested inside plain ScrollViews with the same orientation - use another VirtualizedList-backed container instead.

What is the other VirtualizedList-backed container that i should use, and why is it now advised not to use like that?

over 4 years ago · Santiago Trujillo
3 answers
Answer question

0

If anyone is still looking for a suggestion for the problem @Ponleu and @David Schilling have described here (regarding content going above FlatList), then this is the approach I took:

 <SafeAreaView style={{flex: 1}}> <FlatList data={data} ListHeaderComponent={ContentThatGoesAboveTheFlatList} ListFooterComponent={ContentThatGoesBelowTheFlatList} /></SafeAreaView>

You can read more about it here: https://facebook.github.io/react-native/docs/flatlist#listheadercomponent

I hope it helps someone. :)

Yes this is the solution with SafeAreaView

over 4 years ago · Santiago Trujillo Report

0

In case this helps anyone, this is how I fixed the error in my case.

I had a FlatList nested inside a ScrollView :

 render() { return ( <ScrollView> <Text>{'My Title'}</Text> <FlatList data={this.state.myData} renderItem={({ item }) => { return <p>{item.name}</p>; }} /> {this.state.loading && <Text>{'Loading...'}</Text>} </ScrollView> ); }

and got rid of the ScrollView using FlatList to render everything I needed, which removed the warning:

 render() { const getHeader = () => { return <Text>{'My Title'}</Text>; }; const getFooter = () => { if (this.state.loading) { return null; } return <Text>{'Loading...'}</Text>; }; return ( <FlatList data={this.state.myData} renderItem={({ item }) => { return <p>{item.name}</p>; }} ListHeaderComponent={getHeader} ListFooterComponent={getFooter} /> ); }
over 4 years ago · Santiago Trujillo Report

0

The best way is to disable that warning because sometimes Flatlist need to be in ScrollView.

UPDATE RN V0.63 ABOVE

YellowBox is now changed and replace with LogBox

FUNCTIONAL

import React, { useEffect } from 'react';
import { LogBox } from 'react-native';

useEffect(() => {
    LogBox.ignoreLogs(['VirtualizedLists should never be nested']);
}, [])

CLASS BASED

import React from 'react';
import { LogBox } from 'react-native';

componentDidMount() {
    LogBox.ignoreLogs(['VirtualizedLists should never be nested']);
}

UPDATE RN V0.63 BELOW

FUNCTIONAL

import React, { useEffect } from 'react';
import { YellowBox } from 'react-native';

useEffect(() => {
    YellowBox.ignoreWarnings(['VirtualizedLists should never be nested']);
}, [])

CLASS BASED

import React from 'react';
import { YellowBox } from 'react-native';

componentDidMount() {
    YellowBox.ignoreWarnings(['VirtualizedLists should never be nested']);
}
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!