Initial commit

This commit is contained in:
2025-03-07 19:22:02 +01:00
commit 4a98255d83
55743 changed files with 5280367 additions and 0 deletions
@@ -0,0 +1,17 @@
import { useTabster } from './useTabster';
import * as React from 'react';
/**
* Subscribes to the tabster focused element. Calls the callback when the focused element changes.
* @param callback - Callback to subscribe to the focused element.
*/ export function useFocusedElementChange(callback) {
const tabster = useTabster();
React.useEffect(()=>{
if (tabster) {
tabster.focusedElement.subscribe(callback);
return ()=>tabster.focusedElement.unsubscribe(callback);
}
}, [
tabster,
callback
]);
}