@@ -61,7 +61,7 @@ const defaultOptions = {
61
61
strengthMultiplier : 30
62
62
} ;
63
63
64
- export function useDndScrolling ( componentRef , passedOptions ) {
64
+ export function useDndScrolling ( componentRef , scrollingOptions ) {
65
65
const { dragDropManager } = useContext ( DndContext ) ;
66
66
if ( ! dragDropManager ) {
67
67
throw new Error (
@@ -73,14 +73,14 @@ export function useDndScrolling(componentRef, passedOptions) {
73
73
if ( ! componentRef . current ) {
74
74
return ( ) => { } ;
75
75
}
76
- const options = { ...defaultOptions , ...passedOptions } ;
76
+ const options = { ...defaultOptions , ...scrollingOptions } ;
77
77
const monitor = new ScrollingMonitor ( dragDropManager , componentRef . current , options ) ;
78
78
monitor . start ( ) ;
79
79
return ( ) => {
80
80
monitor . stop ( ) ;
81
81
} ;
82
82
// eslint-disable-next-line react-hooks/exhaustive-deps
83
- } , [ componentRef . current , dragDropManager , passedOptions ] ) ;
83
+ } , [ componentRef . current , dragDropManager , scrollingOptions ] ) ;
84
84
}
85
85
86
86
export default function withScrolling ( WrappedComponent ) {
@@ -90,7 +90,7 @@ export default function withScrolling(WrappedComponent) {
90
90
horizontalStrength,
91
91
onScrollChange,
92
92
93
- ...passedProps
93
+ ...restProps
94
94
} ) {
95
95
const ref = useRef ( null ) ;
96
96
useDndScrolling ( ref , {
@@ -100,7 +100,7 @@ export default function withScrolling(WrappedComponent) {
100
100
onScrollChange
101
101
} ) ;
102
102
103
- return < WrappedComponent { ...passedProps } ref = { ref } /> ;
103
+ return < WrappedComponent { ...restProps } ref = { ref } /> ;
104
104
}
105
105
106
106
ScrollingComponent . displayName = `Scrolling(${ getDisplayName ( WrappedComponent ) } )` ;
@@ -110,7 +110,6 @@ export default function withScrolling(WrappedComponent) {
110
110
horizontalStrength : PropTypes . func ,
111
111
strengthMultiplier : PropTypes . number
112
112
} ;
113
- ScrollingComponent . defaultProps = defaultOptions ;
114
113
115
114
return hoist ( ScrollingComponent , WrappedComponent ) ;
116
115
}
0 commit comments