Website : rimsha.abasa.com
backdoor
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
var
/
canvas
/
node_modules
/
react-beautiful-dnd
/
src
/
view
/
Filename :
use-previous-ref.js
back
Copy
// @flow import { useRef, useEffect } from 'react'; export default function usePrevious<T>(current: T): {| current: T |} { const ref = useRef<T>(current); // will be updated on the next render useEffect(() => { ref.current = current; }); // return the existing current (pre render) return ref; }