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

Function getSliderThumbId

packages/react-aria/src/slider/utils.ts:11–18  ·  view source on GitHub ↗
(state: SliderState, index: number)

Source from the content-addressed store, hash-verified

9export const sliderData: WeakMap<SliderState, SliderData> = new WeakMap<SliderState, SliderData>();
10
11export function getSliderThumbId(state: SliderState, index: number): string {
12 let data = sliderData.get(state);
13 if (!data) {
14 throw new Error('Unknown slider state');
15 }
16
17 return `${data.id}-${index}`;
18}

Callers 2

useSliderFunction · 0.90
useSliderThumbFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected