Skip to content

Commit

Permalink
Merge pull request #3529 from AvikAgarwala/Dev
Browse files Browse the repository at this point in the history
Update usePrevious.ts
  • Loading branch information
NikCharlebois authored Sep 5, 2023
2 parents 9bde5fe + c008893 commit e703724
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions generator/src/hooks/usePrevious.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { useEffect, useRef } from 'react';

export default function usePrevious<T>(state: T): T | undefined {
const ref = useRef<T>();
const ref = useRef<T | undefined>();

useEffect(() => {
ref.current = state;
});
}, [state]);

return ref.current;
}

0 comments on commit e703724

Please sign in to comment.