Skip to content

[Table] Expose ColumnResizerContext and other contexts from RACΒ #7733

Open
@jaknas

Description

@jaknas

Provide a general summary of the feature here

Hi team. I've been trying to replicate RAC Table components based on react-aria hooks since I'd like to get access to internals like column.index from inside the Column component.

As far as I'm aware, it's not possible to get access to that just by using RAC components. We need to drop a layer down and use hooks combined with createLeafComponent, basically replicating what's already implemented in RAC.

What's blocking me currently from doing that is access to some internal contexts that are not exported from RAC, in case of column e.g ColumnResizerContext. I wouldn't mind also getting access to ResizableTableContainerContext.

πŸ€” Expected Behavior?

All contexts in Table.tsx are exported to allow consumption from outside of RAC.

😯 Current Behavior

Only part of contexts (e.g TableContext) are exposed.

πŸ’ Possible Solution

Expose contexts. Alternatively, provide ways to access internal data like e.g column.index from inside of Column component.

Maybe there's already an existing way to achieve it? Like wrapping RAC components in another layer of createLeafComponent?

πŸ”¦ Context

I'm trying to implement some responsive features like e.g column dropping based on table width. This needs to be done generically with respect to how those Tables can be constructed based on RAC documentation (render props, created statically etc.).

πŸ’» Examples

No response

🧒 Your Company/Team

No response

πŸ•· Tracking Issue

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions