[Table] Context from a wrapper around Column is lost when the column header renders
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 52/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- react, typescript
- 领域
- frontend
调研方向
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.
由索引模型根据 Issue 内容生成。
描述
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
- 主要语言
- TypeScript
- 星标
- 16k
- 派生
- 1.6k
- 平均合并
- 4 天 3 小时
- 30 天内合并 PR
- 39
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
adobe/react-spectrum 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 76/100
adobe/react-spectrum#10940 ·
维护者通常 1 天内回复
-
@internationalized/number: NumberParser misparses Arabic-digit numbers that use . , or ، (sd parses ١٬٢٣٤.٥ as 12345)可能已有人在做 @itsrayeedscodespace 于 1 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
adobe/react-spectrum#10936 · 3 条评论 ·
维护者通常 1 天内回复
-
PreviewTrigger: the preview dialog has no accessible name可能已有人在做 @therealemmanueloppong 于 3 天前认领。 未关闭accessibility bug PreviewTrigger
难度 2/5 1-3 小时 新手友好度 76/100
adobe/react-spectrum#10917 · 3 条评论 ·
维护者通常 1 天内回复
-
S2 quiet Picker menu is always 192px wide: its width calc() has no unit可能已有人在做 @darshpatel1052 于 6 天前认领。 未关闭waiting on author
难度 2/5 1 小时以内 新手友好度 88/100
adobe/react-spectrum#10909 · 3 条评论 ·
维护者通常 1 天内回复
-
DatePicker omits timezone for initially empty fields despite zoned placeholderValue可能已有人在做 @mrlexcoder 于 6 天前认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 68/100
adobe/react-spectrum#10900 · 2 条评论 ·
维护者通常 1 天内回复
查看 adobe/react-spectrum 的全部 Issue
相似的 Issue
-
Recording drops clicks on links, filters and checkboxes that share a form with a search field可能已有人在做 @columbia11 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
Tencent/BrowserSkill#657 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 65/100
维护者通常 2 天内回复
-
Choosing a folder while continuing an Antigravity session submits a history fork the runtime rejects未关闭
难度 2/5 1-3 小时 新手友好度 87/100
-
ai-handle
难度 2/5 1-3 小时 新手友好度 78/100
nextlevelbuilder/dewee-web-v2#138 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
NEARBuilders/citynode.app#512 ·
维护者通常 1 天内回复