Skip to content

Commit

Permalink
fix(hooks): fix useTrackPlayerEvents dependencies (#1672)
Browse files Browse the repository at this point in the history
  • Loading branch information
puckey committed Aug 24, 2022
1 parent 341b4b1 commit f6229d6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export const useTrackPlayerEvents = <T extends Event[], H extends (data: EventsP
const savedHandler = useRef(handler)
savedHandler.current = handler

/* eslint-disable react-hooks/exhaustive-deps */
useEffect(() => {
if (__DEV__) {
const allowedTypes = Object.values(Event)
Expand All @@ -74,7 +75,7 @@ export const useTrackPlayerEvents = <T extends Event[], H extends (data: EventsP
)

return () => subs.forEach(sub => sub.remove())
}, [events])
}, events)
}

/**
Expand Down

0 comments on commit f6229d6

Please sign in to comment.