Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đang mở
#4,485 6 bình luận 1 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
38/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
react, typescript
Lĩnh vực
frontend

Hướng nghiên cứu

Bắt đầu với CodeSandbox được liên kết, đặc biệt là /src/NoWorks.tsx, và so sánh dữ liệu bên ngoài component của nó với ví dụ đang hoạt động trong khi chuyển đổi giữa English và Netherlands. Xác nhận xem hàm accessor có bị bỏ qua trong quá trình rerender hay không, sau đó theo dõi hành vi của bảng React liên quan trong v8.5.15. Được xem là hoàn tất khi accessor được chạy và các bản dịch được render cập nhật trong cả hai ví dụ.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.
Ngôn ngữ chính
TypeScript
Star
28.5k
Fork
3.6k
Merge trung bình
2 ngày 3 giờ
Pull request đã merge (30 ngày)
3

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của TanStack/table

Tất cả issue của TanStack/table

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.