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

Function Example

packages/react-aria/test/slider/useSlider.test.js:79–85  ·  view source on GitHub ↗
(props)

Source from the content-addressed store, hash-verified

77 let stateRef = React.createRef();
78
79 function Example(props) {
80 let trackRef = useRef(null);
81 let state = useSliderState({...props, numberFormatter});
82 stateRef.current = state;
83 let {trackProps} = useSlider(props, state, trackRef);
84 return <div data-testid="track" ref={trackRef} {...trackProps} />;
85 }
86
87 it('should allow you to set value of closest thumb by clicking on track', () => {
88 let onChangeSpy = jest.fn();

Callers

nothing calls this directly

Calls 2

useSliderStateFunction · 0.90
useSliderFunction · 0.90

Tested by

no test coverage detected