repo.or.cz
/
ProtonMail-WebClient.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Merge branch 'feat/inda-383-daily-stat' into 'main'
[ProtonMail-WebClient.git]
/
packages
/
hooks
/
usePrevious.ts
blob
1e0845c06a3af4cffec8b6e92feb1486ac9b817a
1
import { useEffect, useRef } from 'react';
2
3
const usePrevious = <T>(value: T) => {
4
const ref = useRef<T>();
5
useEffect(() => {
6
ref.current = value;
7
});
8
return ref.current;
9
};
10
11
export default usePrevious;