# @egjs/react-infinitegrid 中文文档

规范地址：https://npmcn.com/package/%40egjs/react-infinitegrid/

版本：4\.13\.1
npm 元数据更新时间：2026-10-30T10:08:30.922Z
中文译文更新时间：2026-11-13T09:08:18.200Z
软件包许可：MIT

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40egjs/react-infinitegrid
原文对照：https://npmcn.com/package/%40egjs/react-infinitegrid/?lang=original
项目主页：https://github.com/naver/egjs-infinitegrid
源码仓库：https://github.com/naver/egjs-infinitegrid

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：146 kB，68 个文件
- 模块格式：ESM + CJS
- TypeScript 类型：包内自带
- 运行依赖：1 个
- 首次发布：2018-05-06T08:03:02.736Z
- 最新版本发布：2026-10-30T10:08:30.401Z
- 近 30 天下载量：73864（2026-10-13 至 2026-11-11，npm 官方下载统计）
- 已发布版本数：188（近 12 个月 7 个）

## 中文简介

根据网格类型可以无限排列项目的反应组件

## 安装

```sh
npm install @egjs/react-infinitegrid
```

也可以使用：`pnpm add @egjs/react-infinitegrid`、`yarn add @egjs/react-infinitegrid`、`bun add @egjs/react-infinitegrid`

## README

# ![InfiniteGrid Logo](https://naver.github.io/egjs-infinitegrid/img/infinitegrid_logo.png)  
@egjs/反应-无限网格

 [![](https://img.shields.io/npm/v/@egjs/react-infinitegrid.svg?style=flat-square&color=00d8ff&label=version&logo=NPM)](https://www.npmjs.com/package/@egjs/react-infinitegrid)[![npm bundle size (scoped)](https://img.shields.io/bundlephobia/minzip/@egjs/react-infinitegrid.svg?style=flat-square&label=%F0%9F%92%BE%20gzipped&color=007acc) ](https://www.npmjs.com/package/@egjs/react-infinitegrid)[![GitHub commit activity](https://img.shields.io/github/commit-activity/m/naver/egjs-infinitegrid.svg?style=flat-square&label=%E2%AC%86%20commits&color=08CE5D) ](https://github.com/naver/egjs-infinitegrid/graphs/commit-activity)[![npm downloads per month](https://img.shields.io/npm/dm/@egjs/react-infinitegrid.svg?style=flat-square&label=%E2%AC%87%20downloads&color=08CE5D) ](https://www.npmjs.com/package/@egjs/react-infinitegrid)[![GitHub contributors](https://img.shields.io/github/contributors/naver/egjs-infinitegrid.svg?label=%F0%9F%91%A5%20contributors&style=flat-square&color=08CE5D)](https://github.com/naver/egjs-infinitegrid/graphs/contributors) [![GitHub](https://img.shields.io/github/license/naver/egjs-infinitegrid.svg?style=flat-square&label=%F0%9F%93%9C%20license&color=08CE5D)](https://github.com/naver/egjs-infinitegrid/blob/master/LICENSE)

根据网格类型可以无限排列项目的反应组件

[演示](https://naver.github.io/egjs-infinitegrid/) 编号 : [文档](https://naver.github.io/egjs-infinitegrid/docs/api/InfiniteGrid) 编号 : [其他构成部分](https://naver.github.io/egjs/)

## \* 安装

```sh
npm install --save @egjs/react-infinitegrid
```

## QQ 快速启动

```tsx
import * as React from "react";
import { MasonryInfiniteGrid } from "@egjs/react-infinitegrid";

function getItems(nextGroupKey: number, count: number) {
  const nextItems = [];
  const nextKey = nextGroupKey * count;

  for (let i = 0; i < count; ++i) {
    nextItems.push({ groupKey: nextGroupKey, key: nextKey + i });
  }
  return nextItems;
}

const Item = ({ num }: any) => <div className="item">...</div>;

export default function App() {
  const [items, setItems] = React.useState(() => getItems(0, 10));

  return <MasonryInfiniteGrid
    className="container"
    gap={5}
    onRequestAppend={(e) => {
      const nextGroupKey = (+e.groupKey! || 0) + 1;

      setItems([
        ...items,
        ...getItems(nextGroupKey, 10),
      ]);
    }}
  >
    {items.map((item) => <Item data-grid-groupkey={item.groupKey} key={item.key} num={item.key} />)}
  </MasonryInfiniteGrid>;
}
```

## 捐款

见 [捐款额](https://github.com/naver/egjs-infinitegrid/blob/master/CONTRIBUTING.md)。 。 。 .

## \* 反馈

请存档 [问题](https://github.com/naver/egjs-infinitegrid/issues) 标签为“反应”.

## 许可证

egjs- 无限网格在 [麻省理工学院许可证](http://naver.github.io/egjs/license.txt)。 。 。 .

```
Copyright (c) 2015-present NAVER Corp.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
```

[![](https://naver.github.io/egjs/img/logotype1_black.svg)](https://naver.github.io/egjs/)      [![](https://naver.github.io/OpenSourceGuide/book/assets/naver_logo.png)](https://github.com/naver)

## 常见问题

### @egjs/react-infinitegrid 是什么？

根据网格类型可以无限排列项目的反应组件

### 如何安装 @egjs/react-infinitegrid？

在项目目录运行 npm install @egjs/react-infinitegrid，或使用 pnpm add / yarn add / bun add。

### @egjs/react-infinitegrid 支持 TypeScript 吗？

支持。包内自带 TypeScript 类型声明（package\.json 声明了 types 入口），安装后即可获得类型提示，无需再安装 @types 包。

### @egjs/react-infinitegrid 支持 ESM 还是 CommonJS？

同时提供 ES Module 与 CommonJS 入口，import 和 require\(\) 都可以使用，打包工具会自动选择合适的版本。

### @egjs/react-infinitegrid 可以商用吗？

@egjs/react-infinitegrid 使用 MIT 许可。宽松许可：允许商业使用、修改和再分发，通常只需在分发时保留原版权与许可声明。以上为概括，不构成法律意见，请以许可原文为准。

### @egjs/react-infinitegrid 的下载量有多少？

根据 npm 官方下载统计，@egjs/react-infinitegrid 在 2026/10/13 – 2026/11/11 这 30 天内被下载 73,864 次，日均约 2,462 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入，适合横向比较热度，不能直接等同于使用人数。

### @egjs/react-infinitegrid 还在维护吗？

最新版本 4\.13\.1 发布于 2026/10/30（14 天前）；至今共发布 188 个版本，其中过去 12 个月发布了 7 个；首次发布于 2018/05/06。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

