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

Function sort

packages/react-stately/src/table/useTableState.ts:164–173  ·  view source on GitHub ↗
(columnKey: Key, direction?: 'ascending' | 'descending')

Source from the content-addressed store, hash-verified

162 isKeyboardNavigationDisabled: collection.size === 0 || isKeyboardNavigationDisabled,
163 setKeyboardNavigationDisabled,
164 sort(columnKey: Key, direction?: 'ascending' | 'descending') {
165 props.onSortChange?.({
166 column: columnKey,
167 direction:
168 direction ??
169 (props.sortDescriptor?.column === columnKey
170 ? OPPOSITE_SORT_DIRECTION[props.sortDescriptor.direction]
171 : 'ascending')
172 });
173 },
174 expandedKeys,
175 toggleKey(key) {
176 setExpandedKeys(keys => {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected