Remove type cast
This commit is contained in:
parent
b8e54750a0
commit
926c45488d
1 changed files with 5 additions and 1 deletions
|
@ -382,9 +382,13 @@ export const useRovingTabIndex = <T extends HTMLElement>(
|
||||||
}, []); // eslint-disable-line react-hooks/exhaustive-deps
|
}, []); // eslint-disable-line react-hooks/exhaustive-deps
|
||||||
|
|
||||||
const onFocus = useCallback(() => {
|
const onFocus = useCallback(() => {
|
||||||
|
if (!nodeRef.current) {
|
||||||
|
console.warn("useRovingTabIndex.onFocus called but the react ref does not point to any DOM element!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
context.dispatch({
|
context.dispatch({
|
||||||
type: Type.SetFocus,
|
type: Type.SetFocus,
|
||||||
payload: { node: nodeRef.current } as { node: T },
|
payload: { node: nodeRef.current },
|
||||||
});
|
});
|
||||||
}, []); // eslint-disable-line react-hooks/exhaustive-deps
|
}, []); // eslint-disable-line react-hooks/exhaustive-deps
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue