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

Function useDragSession

packages/react-aria/src/dnd/DragManager.ts:102–114  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

100}
101
102export function useDragSession(): DragSession | null {
103 let [session, setSession] = useState(dragSession);
104
105 useEffect(() => {
106 let cb = () => setSession(dragSession);
107 subscriptions.add(cb);
108 return () => {
109 subscriptions.delete(cb);
110 };
111 }, []);
112
113 return session;
114}
115
116/** @private */
117export function isVirtualDragging(): boolean {

Callers

nothing calls this directly

Calls 2

deleteMethod · 0.80
addMethod · 0.65

Tested by

no test coverage detected