Comparing version 2.2.0 to 2.3.0
@@ -24,4 +24,13 @@ import * as React from 'react'; | ||
motionDeadline?: number; | ||
/** | ||
* Create element in view even the element is invisible. | ||
* Will patch `display: none` style on it. | ||
*/ | ||
forceRender?: boolean; | ||
/** | ||
* Remove element when motion end. This will not work when `forceRender` is set. | ||
*/ | ||
removeOnLeave?: boolean; | ||
leavedClassName?: string; | ||
/** @private Used by CSSMotionList. Do not use in your production. */ | ||
eventProps?: object; | ||
@@ -28,0 +37,0 @@ onAppearPrepare?: MotionPrepareEventHandler; |
@@ -38,2 +38,3 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty"; | ||
removeOnLeave = _props$removeOnLeave === void 0 ? true : _props$removeOnLeave, | ||
forceRender = props.forceRender, | ||
children = props.children, | ||
@@ -86,2 +87,8 @@ motionName = props.motionName, | ||
}), setNodeRef); | ||
} else if (forceRender) { | ||
motionChildren = children(_objectSpread(_objectSpread({}, eventProps), {}, { | ||
style: { | ||
display: 'none' | ||
} | ||
}), setNodeRef); | ||
} else { | ||
@@ -88,0 +95,0 @@ motionChildren = null; |
@@ -24,4 +24,13 @@ import * as React from 'react'; | ||
motionDeadline?: number; | ||
/** | ||
* Create element in view even the element is invisible. | ||
* Will patch `display: none` style on it. | ||
*/ | ||
forceRender?: boolean; | ||
/** | ||
* Remove element when motion end. This will not work when `forceRender` is set. | ||
*/ | ||
removeOnLeave?: boolean; | ||
leavedClassName?: string; | ||
/** @private Used by CSSMotionList. Do not use in your production. */ | ||
eventProps?: object; | ||
@@ -28,0 +37,0 @@ onAppearPrepare?: MotionPrepareEventHandler; |
@@ -61,2 +61,3 @@ "use strict"; | ||
removeOnLeave = _props$removeOnLeave === void 0 ? true : _props$removeOnLeave, | ||
forceRender = props.forceRender, | ||
children = props.children, | ||
@@ -109,2 +110,8 @@ motionName = props.motionName, | ||
}), setNodeRef); | ||
} else if (forceRender) { | ||
motionChildren = children((0, _objectSpread2.default)((0, _objectSpread2.default)({}, eventProps), {}, { | ||
style: { | ||
display: 'none' | ||
} | ||
}), setNodeRef); | ||
} else { | ||
@@ -111,0 +118,0 @@ motionChildren = null; |
{ | ||
"name": "rc-motion", | ||
"version": "2.2.0", | ||
"version": "2.3.0", | ||
"description": "React lifecycle controlled motion library", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
88867
1922