You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
653 B
36 lines
653 B
"use strict";
|
|
|
|
exports.__esModule = true;
|
|
exports.default = void 0;
|
|
|
|
var _react = require("react");
|
|
|
|
function NoopTransition({
|
|
children,
|
|
in: inProp,
|
|
mountOnEnter,
|
|
unmountOnExit
|
|
}) {
|
|
const hasEnteredRef = (0, _react.useRef)(inProp);
|
|
(0, _react.useEffect)(() => {
|
|
if (inProp) hasEnteredRef.current = true;
|
|
}, [inProp]);
|
|
if (inProp) return children; // not in
|
|
//
|
|
// if (!mountOnEnter && !unmountOnExit) {
|
|
// return children;
|
|
// }
|
|
|
|
if (unmountOnExit) {
|
|
return null;
|
|
}
|
|
|
|
if (!hasEnteredRef.current && mountOnEnter) {
|
|
return null;
|
|
}
|
|
|
|
return children;
|
|
}
|
|
|
|
var _default = NoopTransition;
|
|
exports.default = _default; |