minishouyin/node_modules/antd/es/typography/hooks/usePrevious.js

9 lines
210 B
JavaScript
Raw Normal View History

2025-11-12 11:35:57 +08:00
import { useEffect, useRef } from 'react';
const usePrevious = value => {
const ref = useRef(undefined);
useEffect(() => {
ref.current = value;
});
return ref.current;
};
export default usePrevious;