Skip to content

Commit

Permalink
Remove unneeded undefined typing
Browse files Browse the repository at this point in the history
Co-authored-by: Marco Ciampini <marco.ciampo@gmail.com>
  • Loading branch information
chad1008 and ciampo committed Mar 14, 2023
1 parent 26874a4 commit 56b15f2
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ function ControlPoints( {
// Adding `cleanEventListeners` to the dependency array below requires the function itself to be wrapped in a `useCallback`
// This memoization would prevent the event listeners from being properly cleaned.
// Instead, we'll pass a ref to the function in our `useEffect` so `cleanEventListeners` itself is no longer a dependency.
const cleanEventListenersRef = useRef< ( () => void ) | undefined >();
const cleanEventListenersRef = useRef< () => void >();
cleanEventListenersRef.current = cleanEventListeners;

useEffect( () => {
Expand Down

0 comments on commit 56b15f2

Please sign in to comment.