fix: useMouse & useMouseHovered type definitions for SVG (#479)

fix: useMouse & useMouseHovered type definitions for SVG
This commit is contained in:
Vadim Dalecky 2019-07-21 21:12:02 +02:00 committed by GitHub
commit e2e4a60f57
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -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.');

View File

@ -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;