[Table] Context from a wrapper around Column is lost when the column header renders
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 52/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- react, typescript
- Ambito
- frontend
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- TypeScript
- Stelle
- 16k
- Fork
- 1.6k
- Merge medio
- 3g 9h
- PR unite (30g)
- 45
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di adobe/react-spectrum
-
accessibility bug PreviewTrigger
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
adobe/react-spectrum#10917 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
S2 quiet Picker menu is always 192px wide: its width calc() has no unitForse già presa @darshpatel1052 l’ha presa 1 giorno fa. Apertawaiting on author
Difficoltà 2/5 Meno di un'ora Idoneità per principianti 88/100
adobe/react-spectrum#10909 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
DatePicker omits timezone for initially empty fields despite zoned placeholderValueForse già presa @mrlexcoder l’ha presa 2 giorni fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
adobe/react-spectrum#10900 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Separator adds a redundant role="separator" to its default <hr>Forse già presa @Janani-bn l’ha presa 2 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
adobe/react-spectrum#10894 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
ComboBox with selectionMode="multiple": Cmd/Ctrl+A does nothing while the popover is openForse già presa @mangeshraut712 l’ha presa 8 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
adobe/react-spectrum#10866 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di adobe/react-spectrum
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
Open-Earth-Foundation/CityCatalyst#3399 ·
I maintainer di solito rispondono entro 2 giorni
-
userReport
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
nkprasad12/morcus-net#631 ·
I maintainer di solito rispondono entro 1 giorno
-
fix(app): fail closed if GetGeneralSetting fails during initializationForse già presa @kalavt l’ha presa oggi. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
nekko-labs/nekko-agent#1756 ·
I maintainer di solito rispondono entro 1 giorno
-
needs-area-label
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
I maintainer di solito rispondono entro 2 giorni