UNPKG
@ntragas/pouncejstest
Version:
latest (1.0.0)
1.0.0
A collection of UI components from Panther labs
github.com/panther-labs/pounce
panther-labs/pounce
@ntragas/pouncejstest
/
dist
/
esm
/
utils
/
usePrevious.js
11 lines
(9 loc)
•
210 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
import
React
from
'react'
;
function
usePrevious
(
value
) {
var
ref =
React
.
useRef
();
React
.
useEffect
(
function
(
) { ref.
current
= value; }, [value]);
return
ref.
current
; }
export
default
usePrevious;