Skip to content

Commit

Permalink
Added generic usage to the hook
Browse files Browse the repository at this point in the history
  • Loading branch information
ActiveChooN committed Mar 18, 2021
1 parent 21e1505 commit c38f3f7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cvat-ui/src/utils/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import { useRef, useEffect } from 'react';

// eslint-disable-next-line import/prefer-default-export
export function usePrevious(value: any): any {
const ref = useRef();
export function usePrevious<T>(value: T): T | undefined {
const ref = useRef<T>();
useEffect(() => {
ref.current = value;
});
Expand Down

0 comments on commit c38f3f7

Please sign in to comment.