[Table] Context from a wrapper around Column is lost when the column header renders
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
- 52/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- react, typescript
- Lĩnh vực
- frontend
Hướng nghiên cứu
Start with the minimal Table/Column reproduction using react-aria-components 1.21.1, @tanstack/react-table 9.2.4, and React 19.3.0, then trace how RAC collects and renders Column header content. Confirm the failure of useHeaderContext() and investigate whether the provider can remain available or whether a renderer API is needed. Done means the header context works through Column rendering, or a documented way exists to pass the collected header instance explicitly.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Description
I am integrating TanStack Table v9's createTableHook with React Aria Components Table. TanStack’s hook factory can register header components that use a context hook such as useHeaderContext() to access the current TanStack header's state.
This works when the registered component is rendered in the normal React tree. It fails when used as the content of a React Aria Column: RAC collects the column definitions and renders their header content through its collection machinery, outside the wrapper’s context provider.
This seems related to #7049: “Context set in collection item node not propagating”, which describes the same general context-propagation problem. This report is a concrete Table/Column integration case.
Minimal example
A simplified TanStack hook registers a component that reads the current header from context:
const { useAppTable, useHeaderContext } = createTableHook({
features,
headerComponents: {
SortableHeader: () => {
const header = useHeaderContext();
return (
<Column
id={header.id}
allowsSorting={header.column.getCanSort()}
>
<FlexRender header={header} />
</Column>
);
},
},
});
The app wraps that component in TanStack’s header provider:
<table.AppTable>
<Table>
<TableHeader>
{headers.map((header) => (
<table.AppHeader header={header} key={header.id}>
{(appHeader) => <appHeader.SortableHeader />}
</table.AppHeader>
))}
</TableHeader>
{/* rows */}
</Table>
</table.AppTable>
At runtime, useHeaderContext() throws:
useHeaderContext must be used within an AppHeader or AppFooter component.
Passing the header explicitly instead of reading it from context works around the problem:
<Column id={header.id} allowsSorting={header.column.getCanSort()}>
<FlexRender header={header} />
</Column>
Expected behavior
A React context provider around a Column’s rendered header content would remain available to that content, or RAC would provide an API for passing the collected column/header instance to the renderer without relying on context.
Actual behavior
The provider appears to wrap the JSX returned for the column, but the content rendered by RAC’s collection-based table header does not receive that context.
Environment
react-aria-components:1.21.1@tanstack/react-table:9.2.4- React:
19.3.0
- Ngôn ngữ chính
- TypeScript
- Star
- 16k
- Fork
- 1.6k
- Merge trung bình
- 3 ngày 19 giờ
- Pull request đã merge (30 ngày)
- 46
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của adobe/react-spectrum
-
PreviewTrigger: the preview dialog has no accessible nameCó thể đã có người làm @therealemmanueloppong đã nhận hôm nay. Đang mởaccessibility bug PreviewTrigger
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
adobe/react-spectrum#10917 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
S2 quiet Picker menu is always 192px wide: its width calc() has no unitCó thể đã có người làm @darshpatel1052 đã nhận 3 ngày trước. Đang mởwaiting on author
Độ khó 2/5 Dưới một giờ Mức phù hợp với người mới 88/100
adobe/react-spectrum#10909 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
DatePicker omits timezone for initially empty fields despite zoned placeholderValueCó thể đã có người làm @mrlexcoder đã nhận 3 ngày trước. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
adobe/react-spectrum#10900 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Separator adds a redundant role="separator" to its default <hr>Có thể đã có người làm @Janani-bn đã nhận 4 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
adobe/react-spectrum#10894 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
ComboBox with selectionMode="multiple": Cmd/Ctrl+A does nothing while the popover is openCó thể đã có người làm @mangeshraut712 đã nhận 10 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
adobe/react-spectrum#10866 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của adobe/react-spectrum
Issue tương tự
-
Navbar avatar and name stay stale after saving profile changesCó thể đã có người làm @alexechoi đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
marmelab/atomic-crm#416 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
feature-request
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
bluesky-social/social-app#12343 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
lucide-icons/lucide#5165 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Feature] Preferences - Keep the theme selection popover open after selection for quick previewĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
marktext/marktext#6033 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:desktop bug has repro platform:macos
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
anthropics/claude-code#107903 ·