We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ef9b265 commit 342d2abCopy full SHA for 342d2ab
client/common/usePrevious.ts
@@ -5,8 +5,8 @@ import { useEffect, useRef } from 'react';
5
* @param value - The current value to track.
6
* @returns The previous value before the current render, or undefined if none.
7
*/
8
-export function usePrevious(value: unknown): unknown | undefined {
9
- const ref = useRef<unknown>();
+export function usePrevious<T>(value: T): T | undefined {
+ const ref = useRef<T>();
10
11
useEffect(() => {
12
ref.current = value;
0 commit comments