mirror of
https://github.com/streamich/react-use.git
synced 2026-01-18 14:06:52 +00:00
fix: useMouse & useMouseHovered type definitions for SVG (#479)
fix: useMouse & useMouseHovered type definitions for SVG
This commit is contained in:
commit
e2e4a60f57
@ -11,7 +11,7 @@ export interface State {
|
||||
elW: number;
|
||||
}
|
||||
|
||||
const useMouse = (ref: RefObject<HTMLElement>): State => {
|
||||
const useMouse = (ref: RefObject<Element>): State => {
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
if (typeof ref !== 'object' || typeof ref.current === 'undefined') {
|
||||
console.error('useMouse expects a single ref argument.');
|
||||
|
||||
@ -9,7 +9,7 @@ export interface UseMouseHoveredOptions {
|
||||
|
||||
const nullRef = { current: null };
|
||||
|
||||
const useMouseHovered = (ref: RefObject<HTMLElement>, options: UseMouseHoveredOptions = {}): State => {
|
||||
const useMouseHovered = (ref: RefObject<Element>, options: UseMouseHoveredOptions = {}): State => {
|
||||
const whenHovered = !!options.whenHovered;
|
||||
const bound = !!options.bound;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user