victory-stack
Advanced tools
Comparing version 36.8.1 to 36.8.2
# victory-stack | ||
## 36.8.2 | ||
### Patch Changes | ||
- Assign merged props to a const instead of modifying initialProps ([#2718](https://github.com/FormidableLabs/victory/pull/2718)) | ||
## 36.8.1 | ||
@@ -4,0 +10,0 @@ |
@@ -31,5 +31,6 @@ import _isEmpty from "lodash/isEmpty"; | ||
var VictoryStackBase = function (initialProps) { | ||
// eslint-disable-next-line no-use-before-define | ||
var role = VictoryStack.role; | ||
initialProps = _objectSpread(_objectSpread({}, defaultProps), initialProps); | ||
var propsWithDefaults = React.useMemo(function () { | ||
return _objectSpread(_objectSpread({}, defaultProps), initialProps); | ||
}, [initialProps]); | ||
@@ -41,3 +42,3 @@ var _Hooks$useAnimationSt = Hooks.useAnimationState(), | ||
var props = getProps(initialProps); | ||
var props = getProps(propsWithDefaults); | ||
var modifiedProps = Helpers.modifyProps(props, fallbackProps, role); | ||
@@ -96,4 +97,4 @@ var eventKey = modifiedProps.eventKey, | ||
var userProps = React.useMemo(function () { | ||
return UserProps.getSafeUserProps(initialProps); | ||
}, [initialProps]); | ||
return UserProps.getSafeUserProps(propsWithDefaults); | ||
}, [propsWithDefaults]); | ||
var container = React.useMemo(function () { | ||
@@ -111,11 +112,11 @@ if (standalone) { | ||
}, [props]); | ||
var previousProps = Hooks.usePreviousProps(initialProps); | ||
var previousProps = Hooks.usePreviousProps(propsWithDefaults); | ||
React.useEffect(function () { | ||
// This is called before dismount to keep state in sync | ||
return function () { | ||
if (initialProps.animate) { | ||
setAnimationState(previousProps, initialProps); | ||
if (propsWithDefaults.animate) { | ||
setAnimationState(previousProps, propsWithDefaults); | ||
} | ||
}; | ||
}, [setAnimationState, previousProps, initialProps]); | ||
}, [setAnimationState, previousProps, propsWithDefaults]); | ||
@@ -122,0 +123,0 @@ if (!_isEmpty(events)) { |
@@ -48,6 +48,8 @@ "use strict"; | ||
var VictoryStackBase = function (initialProps) { | ||
// eslint-disable-next-line no-use-before-define | ||
var role = VictoryStack.role; | ||
initialProps = _objectSpread(_objectSpread({}, defaultProps), initialProps); | ||
var propsWithDefaults = _react.default.useMemo(function () { | ||
return _objectSpread(_objectSpread({}, defaultProps), initialProps); | ||
}, [initialProps]); | ||
var _Hooks$useAnimationSt = _victoryCore.Hooks.useAnimationState(), | ||
@@ -58,3 +60,3 @@ setAnimationState = _Hooks$useAnimationSt.setAnimationState, | ||
var props = getProps(initialProps); | ||
var props = getProps(propsWithDefaults); | ||
@@ -119,4 +121,4 @@ var modifiedProps = _victoryCore.Helpers.modifyProps(props, fallbackProps, role); | ||
var userProps = _react.default.useMemo(function () { | ||
return _victoryCore.UserProps.getSafeUserProps(initialProps); | ||
}, [initialProps]); | ||
return _victoryCore.UserProps.getSafeUserProps(propsWithDefaults); | ||
}, [propsWithDefaults]); | ||
@@ -136,3 +138,3 @@ var container = _react.default.useMemo(function () { | ||
var previousProps = _victoryCore.Hooks.usePreviousProps(initialProps); | ||
var previousProps = _victoryCore.Hooks.usePreviousProps(propsWithDefaults); | ||
@@ -142,7 +144,7 @@ _react.default.useEffect(function () { | ||
return function () { | ||
if (initialProps.animate) { | ||
setAnimationState(previousProps, initialProps); | ||
if (propsWithDefaults.animate) { | ||
setAnimationState(previousProps, propsWithDefaults); | ||
} | ||
}; | ||
}, [setAnimationState, previousProps, initialProps]); | ||
}, [setAnimationState, previousProps, propsWithDefaults]); | ||
@@ -149,0 +151,0 @@ if (!(0, _isEmpty2.default)(events)) { |
{ | ||
"name": "victory-stack", | ||
"version": "36.8.1", | ||
"version": "36.8.2", | ||
"description": "Stack Layout Component for Victory", | ||
@@ -26,4 +26,4 @@ "keywords": [ | ||
"react-fast-compare": "^3.2.0", | ||
"victory-core": "^36.8.1", | ||
"victory-shared-events": "^36.8.1" | ||
"victory-core": "^36.8.2", | ||
"victory-shared-events": "^36.8.2" | ||
}, | ||
@@ -30,0 +30,0 @@ "peerDependencies": { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
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
1033298
18286
149
3
6
1
31
Updatedvictory-core@^36.8.2