MCPcopy Create free account
hub / github.com/adobe/react-spectrum / useTableCell

Function useTableCell

packages/react-aria/src/table/useTableCell.ts:64–82  ·  view source on GitHub ↗
(
  props: AriaTableCellProps,
  state: TableState<T>,
  ref: RefObject<FocusableElement | null>
)

Source from the content-addressed store, hash-verified

62 * @param ref - The ref attached to the cell element.
63 */
64export function useTableCell<T>(
65 props: AriaTableCellProps,
66 state: TableState<T>,
67 ref: RefObject<FocusableElement | null>
68): TableCellAria {
69 let {gridCellProps, isPressed} = useGridCell(props, state, ref);
70 let columnKey = props.node.column?.key;
71 if (columnKey != null && state.collection.rowHeaderColumnKeys.has(columnKey)) {
72 // oxlint-disable-next-line react/react-compiler
73 gridCellProps.role = 'rowheader';
74 // oxlint-disable-next-line react/react-compiler
75 gridCellProps.id = getCellId(state, props.node.parentKey!, columnKey);
76 }
77
78 return {
79 gridCellProps,
80 isPressed
81 };
82}

Callers 12

TableCellFunction · 0.90
TableCheckboxCellFunction · 0.90
ResizableTableCellFunction · 0.90
TableCellFunction · 0.90
TableCheckboxCellFunction · 0.90
TableCellFunction · 0.90
TableCheckboxCellFunction · 0.90
Table.tsxFile · 0.90
TableDragCellFunction · 0.90
TableCheckboxCellFunction · 0.90
TableCellFunction · 0.90
TableCellFunction · 0.90

Calls 3

useGridCellFunction · 0.90
getCellIdFunction · 0.90
hasMethod · 0.65

Tested by

no test coverage detected