Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F99424751
useUpdatedRef.js
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, Jan 24, 10:57
Size
283 B
Mime Type
text/x-java
Expires
Sun, Jan 26, 10:57 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
23788800
Attached To
rOACCT Open Access Compliance Check Tool (OACCT)
useUpdatedRef.js
View Options
import { useRef } from 'react';
/**
* Returns a ref that is immediately updated with the new value
*
* @param value The Ref value
* @category refs
*/
export default function useUpdatedRef(value) {
var valueRef = useRef(value);
valueRef.current = value;
return valueRef;
}
Event Timeline
Log In to Comment