mirror of
https://github.com/Tria-plc/emaui.git
synced 2026-08-27 07:22:56 +00:00
13 lines
299 B
JavaScript
13 lines
299 B
JavaScript
import React from 'react';
|
|
import useIsomorphicLayoutEffect from 'use-isomorphic-layout-effect';
|
|
|
|
var useLatest = function useLatest(value) {
|
|
var ref = React.useRef(value);
|
|
useIsomorphicLayoutEffect(function () {
|
|
ref.current = value;
|
|
});
|
|
return ref;
|
|
};
|
|
|
|
export { useLatest as default };
|