Skip to content

Commit

Permalink
fix: useMouse & useMouseHovered type definitions for SVG (#479)
Browse files Browse the repository at this point in the history
fix: useMouse & useMouseHovered type definitions for SVG
  • Loading branch information
streamich authored Jul 21, 2019
2 parents 2e308db + 9e97451 commit e2e4a60
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/useMouse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.');
Expand Down
2 changes: 1 addition & 1 deletion src/useMouseHovered.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit e2e4a60

Please sign in to comment.