react-component / react-component/virtual-list

使用 extraRender 渲染额外的元素,但是虚拟列表中不展示

Open
#290 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
814
Forks
171
Avg merge
1h 3m
Merged PRs (30d)
3

Description

<List
  data={data}
  height={500}
  itemHeight={1}
  itemKey="id"
  style={{
    border: '1px solid red',
    boxSizing: 'border-box',
  }}
  extraRender={() => <div>11111</div>}
>
  {(item) => <ForwardMyItem {...item} />}
</List>

使用官方的 example,添加 extraRender={() => <div>11111</div>}

chatgpt

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the official virtual-list example shown in the report and trace how the extraRender prop is handled when the list renders. Reproduce the case with extraRender returning a div containing 11111, then inspect the rendering path to determine why it is absent. Done means the additional element is visible in the virtual list without breaking the example.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.