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

Function TableRow

packages/react-aria/stories/table/example-resizing.tsx:305–333  ·  view source on GitHub ↗
({
  item,
  children,
  state,
  className
}: {
  item: any;
  children: ReactNode;
  state: any;
  className: string;
})

Source from the content-addressed store, hash-verified

303}
304
305export function TableRow({
306 item,
307 children,
308 state,
309 className
310}: {
311 item: any;
312 children: ReactNode;
313 state: any;
314 className: string;
315}): JSX.Element {
316 let ref = useRef<HTMLTableRowElement | null>(null);
317 let isSelected = state.selectionManager.isSelected(item.key);
318 let {rowProps} = useTableRow({node: item}, state, ref);
319 let {isFocusVisible, focusProps} = useFocusRing();
320
321 return (
322 <tr
323 style={{
324 color: isSelected ? 'white' : undefined,
325 outline: isFocusVisible ? '2px solid orange' : 'none'
326 }}
327 className={className}
328 {...mergeProps(rowProps, focusProps)}
329 ref={ref}>
330 {children}
331 </tr>
332 );
333}
334
335export function TableCell({
336 cell,

Callers

nothing calls this directly

Calls 4

useTableRowFunction · 0.90
useFocusRingFunction · 0.90
mergePropsFunction · 0.90
isSelectedMethod · 0.65

Tested by

no test coverage detected