99 LEFT ,
1010 RIGHT ,
1111 Setter ,
12+ ConfigurationOptions ,
1213 SwipeableCallbacks ,
1314 SwipeableHandlers ,
1415 SwipeableProps ,
@@ -34,7 +35,7 @@ export {
3435 Vector2 ,
3536} ;
3637
37- const defaultProps = {
38+ const defaultProps : ConfigurationOptions = {
3839 delta : 10 ,
3940 preventDefaultTouchmoveEvent : false ,
4041 rotationAngle : 0 ,
@@ -253,7 +254,7 @@ function getHandlers(
253254 // if new DOM el clean up old DOM and reset cleanUpTouch
254255 if ( state . el && state . el !== el && state . cleanUpTouch ) {
255256 state . cleanUpTouch ( ) ;
256- addState . cleanUpTouch = undefined ;
257+ addState . cleanUpTouch = void 0 ;
257258 }
258259 // only attach if we want to track touch
259260 if ( props . trackTouch && el ) {
@@ -290,7 +291,7 @@ function updateTransientState(
290291 // clean up touch handlers if no longer tracking touches
291292 if ( ! props . trackTouch && state . cleanUpTouch ) {
292293 state . cleanUpTouch ( ) ;
293- addState . cleanUpTouch = undefined ;
294+ addState . cleanUpTouch = void 0 ;
294295 } else if ( props . trackTouch && ! state . cleanUpTouch ) {
295296 // attach/re-attach touch handlers
296297 if ( state . el ) {
@@ -309,7 +310,20 @@ export function useSwipeable(options: SwipeableProps): SwipeableHandlers {
309310 const transientProps = React . useRef < SwipeablePropsWithDefaultOptions > ( {
310311 ...defaultProps ,
311312 } ) ;
312- transientProps . current = { ...defaultProps , ...options } ;
313+ transientProps . current = {
314+ ...defaultProps ,
315+ ...options ,
316+ // Force defaults for config properties
317+ delta : options . delta === void 0 ? defaultProps . delta : options . delta ,
318+ rotationAngle :
319+ options . rotationAngle === void 0
320+ ? defaultProps . rotationAngle
321+ : options . rotationAngle ,
322+ trackTouch :
323+ options . trackTouch === void 0
324+ ? defaultProps . trackTouch
325+ : options . trackTouch ,
326+ } ;
313327
314328 const [ handlers , attachTouch ] = React . useMemo (
315329 ( ) =>
0 commit comments