Search
 
SCRIPT & CODE EXAMPLE
 

TYPESCRIPT

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

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 (
    <FlatList
      data={[]}
      ListEmptyComponent={null}
      keyExtractor={() => "dummy"}
      renderItem={null}
      ListHeaderComponent={() => (
        <React.Fragment>{props.children}</React.Fragment>
      )}
    />
  );
}
Usage:

<VirtualizedView>
  <Text>Anything goes here</Text>
  <FlatList 
    data={data}
    keyExtractor={keyExtractor}
    renderItem={({item}) => <Item data={item} />}
    onRefresh={refetch}
    refreshing={loading}
    onEndReached={concatData}
  />
</VirtualizedView>

This will show scrollbar when you rotate your iPhone, and also remove warning message and performance will be saved without any problem.
Comment

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

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

virtualizedlists should never be nested inside plain scrollviews with the same orientation

<ScrollView>
    {data.map((item, index) => {
        ...your code
    }}
</ScrollView>
Comment

PREVIOUS NEXT
Code Example
Typescript :: google fonts flutter 
Typescript :: copy object in typescript 
Typescript :: get products in wordpress 
Typescript :: React & TypeScript Chrome Extension Development [2021] 
Typescript :: reactnative upload image axios 0.66 
Typescript :: typescript tuples 
Typescript :: map typescript 
Typescript :: class typescript constructor 
Typescript :: eslint airbnb react typescript 
Typescript :: typescript function return array 
Typescript :: Please remove usages of `jcenter()` Maven repository from your build scripts and migrate your build to other Maven repositories. 
Typescript :: convert list to list of lists on every n elements python 
Typescript :: find the number of occurences of each character and print it in the decreasing order of occurences, if 2 or more number occurs the same number of times, print the numbers in decreasing order. 
Typescript :: add comma for input number automatically typescript 
Typescript :: TYPESCRIPT RETURN HTML ELEMENT 
Typescript :: typescript array of react elements 
Typescript :: pnpjs get items from list 
Typescript :: typescript cheat sheet 
Typescript :: downloading youtube playlists using youtube-dl in highest quality 
Typescript :: multer s3 
Typescript :: Parsing error: "parserOptions.project" has been set for @typescript-eslint/parser. 
Typescript :: create custom properties for user firebase 
Typescript :: generic interface typescript 
Typescript :: python lists union 
Typescript :: typescript extend imported namespace 
Typescript :: arrow function in ts 
Typescript :: c# check list of objects for value 
Typescript :: typescript object get value by key 
Typescript :: use sample weights fit model multiclass 
Typescript :: sails.ps1 cannot be loaded because running scripts is disabled on this system. For more information, see about_Execution_Policies 
ADD CONTENT
Topic
Content
Source link
Name
4+4 =