MCPcopy Index your code
hub / github.com/adobe/react-spectrum / useTableCell

Function useTableCell

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

Source from the content-addressed store, hash-verified

50 * @param ref - The ref attached to the cell element.
51 */
52export function useTableCell<T>(
53 props: AriaTableCellProps,
54 state: TableState<T>,
55 ref: RefObject<FocusableElement | null>
56): TableCellAria {
57 let {gridCellProps, isPressed} = useGridCell(props, state, ref);
58 let columnKey = props.node.column?.key;
59 if (columnKey != null && state.collection.rowHeaderColumnKeys.has(columnKey)) {
60 gridCellProps.role = 'rowheader';
61 gridCellProps.id = getCellId(state, props.node.parentKey!, columnKey);
62 }
63
64 return {
65 gridCellProps,
66 isPressed
67 };
68}

Callers 11

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

Calls 3

useGridCellFunction · 0.90
getCellIdFunction · 0.90
hasMethod · 0.65

Tested by

no test coverage detected