Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

React: accessor function don't trigger when data is outside of exported component

未关闭
#4,485 6 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
38/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
react, typescript
领域
frontend

调研方向

从链接的 CodeSandbox 开始,尤其是 /src/NoWorks.tsx,并在 English 和 Netherlands 之间切换时,将其组件外数据与正常工作的示例进行比较。确认 accessor 函数是否在重新渲染期间被跳过,然后追踪 v8.5.15 中涉及的 React 表格行为。当 accessor 执行且两个示例中渲染出的翻译都更新时,即表示完成。

由索引模型根据 Issue 内容生成。

描述

Describe the bug

We faced an issue regarding some cells in our application not triggering their translations correctly.

Looking at the attached codesandbox you can see 2 examples. One working and one not.
We discovered that when data is defined outside the export of the component .accessor function don't trigger as expected.

Your minimal, reproducible example

https://codesandbox.io/s/i18next-react-table-forked-2znx8c?file=/src/NoWorks.tsx

Steps to reproduce
  1. Go to https://codesandbox.io/s/i18next-react-table-forked-2znx8c?file=/src/NoWorks.tsx
  2. Open console
  3. On default you see 'en' language logged by both the 'works' and 'noWorks' component.
  4. Click on Netherlands button
  5. You will see the 'works' rendered language console.log inside 'columnHelper.accessor' does correctly trigger
  6. You will also see the counter for 'noWorks' triggered but the rendered language console.log inside 'columnHelper.accessor' don't trigger
  7. Click on English button and see step 5 to 6 repeated.
Expected behavior

As a User I am expecting the accessor function to trigger despite the DataTable data being imported from outside the component or initiated inside the component.

How often does this bug happen?

Every time

Screenshots or Videos

No response

Platform
  • OS: macOS, Windows
  • Browser: Chrome, Safari, Firefox
react-table version

v8.5.15

TypeScript version

v4.8.4

Additional context

No response

Terms & Code of Conduct
  • I agree to follow this project's Code of Conduct
  • I understand that if my bug cannot be reliable reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.
主要语言
TypeScript
星标
28.4k
派生
3.6k
平均合并
1 天 14 小时
30 天内合并 PR
4

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

TanStack/table 的其他 Issue

查看 TanStack/table 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。