Update to react v19
This commit is contained in:
@@ -77,8 +77,8 @@ export const useAutomaticScrolling = (
|
||||
} => {
|
||||
const isCallback = typeof refOrCallback === 'function';
|
||||
|
||||
const elementStyle = useRef<CSSStyleDeclaration>();
|
||||
const scrollTriggerTimer = useRef<NodeJS.Timeout>();
|
||||
const elementStyle = useRef<CSSStyleDeclaration>(undefined);
|
||||
const scrollTriggerTimer = useRef<NodeJS.Timeout>(undefined);
|
||||
const scrollTriggerAnimationFrameId = useRef(-1);
|
||||
|
||||
const [isActive, setIsActive] = useState(false);
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
import { RefObject, useLayoutEffect, useState } from 'react';
|
||||
|
||||
export const useIntersectionObserver = (
|
||||
ref: RefObject<HTMLElement> | HTMLElement | undefined | null,
|
||||
ref: RefObject<HTMLElement | null> | HTMLElement | undefined | null,
|
||||
callback: IntersectionObserverCallback,
|
||||
{
|
||||
ignoreInitialObserve = false,
|
||||
|
||||
@@ -32,12 +32,12 @@ export const useMouseDragScroll = (
|
||||
) => {
|
||||
const [isDragging, setIsDragging] = useState(false);
|
||||
|
||||
const elementStyle = useRef<CSSStyleDeclaration>();
|
||||
const elementStyle = useRef<CSSStyleDeclaration>(undefined);
|
||||
const previousClickPosX = useRef<Positions>([0, 0, 0]);
|
||||
const previousClickPosY = useRef<Positions>([0, 0, 0]);
|
||||
const previousClickTime = useRef<ClickTimes>([0, 0, 0]);
|
||||
const scrollAtT0 = useRef<[ScrollLeft: number, ScrollTop: number]>([0, 0]);
|
||||
const inertiaTimeInterval = useRef<NodeJS.Timeout>();
|
||||
const inertiaTimeInterval = useRef<NodeJS.Timeout>(undefined);
|
||||
|
||||
useEffect(() => {
|
||||
const element = ref?.current;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
import { RefObject, useLayoutEffect, useState } from 'react';
|
||||
|
||||
export const useResizeObserver = (
|
||||
ref: RefObject<HTMLElement> | HTMLElement | undefined | null,
|
||||
ref: RefObject<HTMLElement | null> | HTMLElement | undefined | null,
|
||||
callback: ResizeObserverCallback,
|
||||
): (() => void) => {
|
||||
const [disconnect, setDisconnect] = useState<() => void>(() => {});
|
||||
|
||||
Reference in New Issue
Block a user