Một mục mã nguồn mở trong kho dữ liệu GitHub của TopGit: Shopify/flash-list, 7.2k sao, TypeScript. A better list for React Native
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
Website •
Discord •
Getting started •
Usage •
Performance •
Known Issues
Fast & performant React Native list. No more blank cells.
Swap from FlatList in seconds. Get instant performance.
FlashList v2
FlashList v2 has been rebuilt from the ground up for RN's new architecture and delivers fast performance, higher precision, and better ease of use compared to v1. We've achieved all this while moving to a JS-only solution! One of the key advantages of FlashList v2 is that it doesn't require any estimates. It also introduces several new features compared to v1. To know more about what's new in v2 click here.
⚠️ IMPORTANT: FlashList v2.x has been designed to be new architecture only and will not run on old architecture. If you're running on old architecture or using FlashList v1.x, you can access the documentation specific to v1 here: FlashList v1 Documentation.
Why use FlashList?
🚀 Superior Performance
No more blank cells: FlashList uses view recycling to ensure smooth scrolling without visible blank areas.
Fast initial render: Optimized for quick first paint.
Supports view types: Great performance even if different types of components make up the list.
Dynamic sizes: Super fast and doesn't need any estimates.
🎯 Developer Experience
Drop-in replacement for FlatList: Simply change the component name - if you know FlatList, you already know FlashList.
No size estimates required in v2: Unlike v1, FlashList v2 automatically handles item sizing.
Type-safe: Full TypeScript support with comprehensive type definitions.
📱 Advanced Features
Masonry layout support: Create Pinterest-style layouts with varying item heights and column spans.
Maintain visible content position: Automatically handles content shifts when adding items (enabled by default in v2).
Multiple recycling pools: Optimizes performance for lists with different item types using getItemType.
Built for React Native's new architecture: FlashList v2 is designed specifically for the new architecture.
⚡ Real-world Benefits
Reduced frame drops: Maintains 60 FPS even with complex item components.
Lower CPU usage: Efficient recycling reduces computational overhead.
Smoother scrolling: Predictable performance even with thousands of items.
JS-only solution in v2: No native dependencies, making it easier to maintain while delivering fast performance.
Installation
Add the package to your project via yarn add @shopify/flash-list.
Usage
But if you are familiar with FlatList, you already know how to use FlashList. You can try out FlashList by changing the component name or refer to the example below:
import React from "react";
import { View, Text } from "react-native";
import { FlashList } from "@shopify/flash-list";
const DATA = [
{
title: "First Item",
},
{
title: "Second Item",
},
];
const MyList = () => {
return (
<FlashList
data={DATA}
renderItem={({ item }) => <Text>{item.title}</Text>}
/>
);
};
To avoid common pitfalls, you can also follow these steps for migrating from FlatList.
App / Playground
The fixture is an example app showing how to use the library.
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/Shopify/flash-list là nguồn chính thức.
Shopify/flash-list có phải mã nguồn mở không?
Có — Shopify/flash-list phát hành theo license MIT, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/Shopify/flash-list.
Shopify/flash-list là gì?
Shopify/flash-list (Shopify/flash-list) là dự án TypeScript trên GitHub. Theo mô tả gốc: A better list for React Native
Đọc đầy đủ README ở tab phía trên.
Muốn nghe thêm một ý kiến về flash-list?
Hỏi một AI đọc được trang này — một cú bấm là có ngay nhận định về flash-list.