File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -39,16 +39,18 @@ export default function useRecognizers<Config extends Partial<GenericOptions>>(
39
39
*/
40
40
const bind = ( ...args : any [ ] ) => {
41
41
current . resetBindings ( )
42
- classes . forEach ( RecognizerClass => {
42
+ for ( let RecognizerClass of classes ) {
43
43
new RecognizerClass ( current , args ) . addBindings ( )
44
- } )
44
+ }
45
45
46
+ // we also add event bindings for native handlers
46
47
if ( controller . nativeRefs ) {
47
- // we also add event bindings for native handlers
48
- Object . entries ( controller . nativeRefs ) . forEach ( ( [ eventName , fn ] ) => {
49
- // we're cheating when it comes to event type :(
50
- current . addBindings ( eventName as ReactEventHandlerKey , fn as Fn )
51
- } )
48
+ for ( let eventName in controller . nativeRefs )
49
+ current . addBindings (
50
+ eventName as ReactEventHandlerKey ,
51
+ // @ts -ignore we're cheating when it comes to event type :(
52
+ controller . nativeRefs [ eventName ] as Fn
53
+ )
52
54
}
53
55
54
56
return current . getBind ( ) as HookReturnType < Config >
You can’t perform that action at this time.
0 commit comments