1
1
/* global document */
2
- import * as React from "react" ;
2
+ import { MouseEvent , useRef , useMemo } from "react" ;
3
3
import {
4
4
AttachTouch ,
5
5
SwipeDirections ,
@@ -91,7 +91,7 @@ function getHandlers(
91
91
) : [
92
92
{
93
93
ref : ( element : HTMLElement | null ) => void ;
94
- onMouseDown ?: ( event : React . MouseEvent ) => void ;
94
+ onMouseDown ?: ( event : MouseEvent ) => void ;
95
95
} ,
96
96
AttachTouch
97
97
] {
@@ -368,13 +368,13 @@ function updateTransientState(
368
368
369
369
export function useSwipeable ( options : SwipeableProps ) : SwipeableHandlers {
370
370
const { trackMouse } = options ;
371
- const transientState = React . useRef ( { ...initialState } ) ;
372
- const transientProps = React . useRef < SwipeablePropsWithDefaultOptions > ( {
371
+ const transientState = useRef ( { ...initialState } ) ;
372
+ const transientProps = useRef < SwipeablePropsWithDefaultOptions > ( {
373
373
...defaultProps ,
374
374
} ) ;
375
375
376
376
// track previous rendered props
377
- const previousProps = React . useRef < SwipeablePropsWithDefaultOptions > ( {
377
+ const previousProps = useRef < SwipeablePropsWithDefaultOptions > ( {
378
378
...transientProps . current ,
379
379
} ) ;
380
380
previousProps . current = { ...transientProps . current } ;
@@ -392,7 +392,7 @@ export function useSwipeable(options: SwipeableProps): SwipeableHandlers {
392
392
}
393
393
}
394
394
395
- const [ handlers , attachTouch ] = React . useMemo (
395
+ const [ handlers , attachTouch ] = useMemo (
396
396
( ) =>
397
397
getHandlers (
398
398
( stateSetter ) =>
0 commit comments