ÿØÿà JFIF ` ` ÿþ
|
Server : Apache System : Linux cloud.heroica.com.br 4.18.0-553.36.1.el8_10.x86_64 #1 SMP Wed Jan 22 03:07:54 EST 2025 x86_64 User : farolpborg ( 1053) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /var/www/node_services/datajud/frontend/node_modules/@restart/ui/esm/ |
Upload File : |
import useEventCallback from '@restart/hooks/useEventCallback';
import useMergedRefs from '@restart/hooks/useMergedRefs';
import { cloneElement, useEffect, useRef } from 'react';
import { getChildRef } from './utils';
function NoopTransition({
children,
in: inProp,
onExited,
mountOnEnter,
unmountOnExit
}) {
const ref = useRef(null);
const hasEnteredRef = useRef(inProp);
const handleExited = useEventCallback(onExited);
useEffect(() => {
if (inProp) hasEnteredRef.current = true;else {
handleExited(ref.current);
}
}, [inProp, handleExited]);
const combinedRef = useMergedRefs(ref, getChildRef(children));
const child = /*#__PURE__*/cloneElement(children, {
ref: combinedRef
});
if (inProp) return child;
if (unmountOnExit) {
return null;
}
if (!hasEnteredRef.current && mountOnEnter) {
return null;
}
return child;
}
export default NoopTransition;