- Updated all component headers and documentation
- Changed navbar and footer branding
- Updated homepage hero badge
- Modified page title in index.html
- Simplified footer text to 'Built with ❤️'
- Consistent V2 capitalization across all references
24 lines
565 B
JavaScript
24 lines
565 B
JavaScript
'use client';
|
|
import { useRef, useEffect } from 'react';
|
|
|
|
const useUpdateEffect = (effect, deps) => {
|
|
const renderCycleRef = useRef(false);
|
|
const effectCycleRef = useRef(false);
|
|
useEffect(() => {
|
|
const isMounted = renderCycleRef.current;
|
|
const shouldRun = isMounted && effectCycleRef.current;
|
|
if (shouldRun) {
|
|
return effect();
|
|
}
|
|
effectCycleRef.current = true;
|
|
}, deps);
|
|
useEffect(() => {
|
|
renderCycleRef.current = true;
|
|
return () => {
|
|
renderCycleRef.current = false;
|
|
};
|
|
}, []);
|
|
};
|
|
|
|
export { useUpdateEffect };
|