victory-chart 36.8.1 → 36.8.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/victory-chart.js +312 -358
- package/dist/victory-chart.min.js +1 -1
- package/es/helper-methods.d.ts +1 -1
- package/es/helper-methods.js +16 -18
- package/es/victory-chart.js +10 -8
- package/lib/helper-methods.d.ts +1 -1
- package/lib/helper-methods.js +18 -18
- package/lib/victory-chart.js +11 -8
- package/package.json +5 -5
- package/src/helper-methods.tsx +14 -14
- package/src/victory-chart.tsx +11 -8
package/es/helper-methods.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
export declare function getBackgroundWithProps(props: any, calculatedProps: any): React.DetailedReactHTMLElement<any, HTMLElement>;
|
|
3
|
-
export declare function getCalculatedProps(
|
|
3
|
+
export declare function getCalculatedProps(initialProps: any, childComponents: any): {
|
|
4
4
|
categories: {
|
|
5
5
|
x: any;
|
|
6
6
|
y: any;
|
package/es/helper-methods.js
CHANGED
|
@@ -84,12 +84,11 @@ function getStyles(props) {
|
|
|
84
84
|
};
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
-
export function getCalculatedProps(
|
|
88
|
-
var style = getStyles(
|
|
89
|
-
props = Helpers.modifyProps(
|
|
90
|
-
var
|
|
91
|
-
|
|
92
|
-
polar = _props.polar;
|
|
87
|
+
export function getCalculatedProps(initialProps, childComponents) {
|
|
88
|
+
var style = getStyles(initialProps);
|
|
89
|
+
var props = Helpers.modifyProps(initialProps, fallbackProps, "chart");
|
|
90
|
+
var horizontal = props.horizontal,
|
|
91
|
+
polar = props.polar;
|
|
93
92
|
var allStrings = Wrapper.getStringsFromChildren(props, childComponents);
|
|
94
93
|
var categories = Wrapper.getCategories(props, childComponents, allStrings);
|
|
95
94
|
var stringMap = createStringMap(props, childComponents, allStrings);
|
|
@@ -128,23 +127,22 @@ export function getCalculatedProps(props, childComponents) {
|
|
|
128
127
|
};
|
|
129
128
|
}
|
|
130
129
|
export function getChildren(props, childComponents, calculatedProps) {
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
var baseStyle =
|
|
130
|
+
var children = childComponents || getChildComponents(props);
|
|
131
|
+
var newCalculatedProps = calculatedProps || getCalculatedProps(props, children);
|
|
132
|
+
var baseStyle = newCalculatedProps.style.parent;
|
|
134
133
|
var height = props.height,
|
|
135
134
|
polar = props.polar,
|
|
136
135
|
theme = props.theme,
|
|
137
136
|
width = props.width;
|
|
138
|
-
var
|
|
139
|
-
|
|
140
|
-
horizontal = _calculatedProps.horizontal;
|
|
137
|
+
var origin = newCalculatedProps.origin,
|
|
138
|
+
horizontal = newCalculatedProps.horizontal;
|
|
141
139
|
var parentName = props.name || "chart";
|
|
142
|
-
return
|
|
140
|
+
return children.filter(React.isValidElement).map(function (child, index) {
|
|
143
141
|
var role = child.type && child.type.role;
|
|
144
142
|
var style = Array.isArray(child.props.style) ? child.props.style : _defaults({}, child.props.style, {
|
|
145
143
|
parent: baseStyle
|
|
146
144
|
});
|
|
147
|
-
var childProps = getChildProps(child, props,
|
|
145
|
+
var childProps = getChildProps(child, props, newCalculatedProps);
|
|
148
146
|
var name = child.props.name || "".concat(parentName, "-").concat(role, "-").concat(index);
|
|
149
147
|
|
|
150
148
|
var newProps = _defaults({
|
|
@@ -156,7 +154,7 @@ export function getChildren(props, childComponents, calculatedProps) {
|
|
|
156
154
|
style: style,
|
|
157
155
|
name: name,
|
|
158
156
|
origin: polar ? origin : undefined,
|
|
159
|
-
padding:
|
|
157
|
+
padding: newCalculatedProps.padding,
|
|
160
158
|
key: "".concat(name, "-key-").concat(index),
|
|
161
159
|
standalone: false
|
|
162
160
|
}, childProps);
|
|
@@ -184,9 +182,9 @@ export var getChildComponents = function (props, defaultAxes) {
|
|
|
184
182
|
};
|
|
185
183
|
|
|
186
184
|
var getDomain = function (props, axis, childComponents) {
|
|
187
|
-
|
|
188
|
-
var domain = Wrapper.getDomain(props, axis,
|
|
189
|
-
var axisComponent = Axis.getAxisComponent(
|
|
185
|
+
var children = childComponents || React.Children.toArray(props.children);
|
|
186
|
+
var domain = Wrapper.getDomain(props, axis, children);
|
|
187
|
+
var axisComponent = Axis.getAxisComponent(children, axis);
|
|
190
188
|
var invertDomain = axisComponent && axisComponent.props && axisComponent.props.invertAxis;
|
|
191
189
|
return invertDomain ? domain.concat().reverse() : domain;
|
|
192
190
|
};
|
package/es/victory-chart.js
CHANGED
|
@@ -42,7 +42,9 @@ var defaultProps = {
|
|
|
42
42
|
};
|
|
43
43
|
|
|
44
44
|
var VictoryChartImpl = function (initialProps) {
|
|
45
|
-
|
|
45
|
+
var propsWithDefaults = React.useMemo(function () {
|
|
46
|
+
return _objectSpread(_objectSpread({}, defaultProps), initialProps);
|
|
47
|
+
}, [initialProps]);
|
|
46
48
|
var role = "chart";
|
|
47
49
|
|
|
48
50
|
var _Hooks$useAnimationSt = Hooks.useAnimationState(),
|
|
@@ -50,7 +52,7 @@ var VictoryChartImpl = function (initialProps) {
|
|
|
50
52
|
setAnimationState = _Hooks$useAnimationSt.setAnimationState,
|
|
51
53
|
getProps = _Hooks$useAnimationSt.getProps;
|
|
52
54
|
|
|
53
|
-
var props = getProps(
|
|
55
|
+
var props = getProps(propsWithDefaults);
|
|
54
56
|
var modifiedProps = Helpers.modifyProps(props, fallbackProps, role);
|
|
55
57
|
var desc = modifiedProps.desc,
|
|
56
58
|
eventKey = modifiedProps.eventKey,
|
|
@@ -116,25 +118,25 @@ var VictoryChartImpl = function (initialProps) {
|
|
|
116
118
|
}, [desc, domain, height, horizontal, name, origin, polar, scale, standalone, style, title, theme, width]);
|
|
117
119
|
var container = React.useMemo(function () {
|
|
118
120
|
if (standalone) {
|
|
119
|
-
var defaultContainerProps = _defaults({}, containerComponent.props, containerProps, UserProps.getSafeUserProps(
|
|
121
|
+
var defaultContainerProps = _defaults({}, containerComponent.props, containerProps, UserProps.getSafeUserProps(propsWithDefaults));
|
|
120
122
|
|
|
121
123
|
return /*#__PURE__*/React.cloneElement(containerComponent, defaultContainerProps);
|
|
122
124
|
}
|
|
123
125
|
|
|
124
126
|
return groupComponent;
|
|
125
|
-
}, [groupComponent, standalone, containerComponent, containerProps,
|
|
127
|
+
}, [groupComponent, standalone, containerComponent, containerProps, propsWithDefaults]);
|
|
126
128
|
var events = React.useMemo(function () {
|
|
127
129
|
return Wrapper.getAllEvents(props);
|
|
128
130
|
}, [props]);
|
|
129
|
-
var previousProps = Hooks.usePreviousProps(
|
|
131
|
+
var previousProps = Hooks.usePreviousProps(propsWithDefaults);
|
|
130
132
|
React.useEffect(function () {
|
|
131
133
|
// This is called before dismount to keep state in sync
|
|
132
134
|
return function () {
|
|
133
|
-
if (
|
|
134
|
-
setAnimationState(previousProps,
|
|
135
|
+
if (propsWithDefaults.animate) {
|
|
136
|
+
setAnimationState(previousProps, propsWithDefaults);
|
|
135
137
|
}
|
|
136
138
|
};
|
|
137
|
-
}, [setAnimationState, previousProps,
|
|
139
|
+
}, [setAnimationState, previousProps, propsWithDefaults]);
|
|
138
140
|
|
|
139
141
|
if (!_isEmpty(events)) {
|
|
140
142
|
return /*#__PURE__*/React.createElement(VictorySharedEvents, {
|
package/lib/helper-methods.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
export declare function getBackgroundWithProps(props: any, calculatedProps: any): React.DetailedReactHTMLElement<any, HTMLElement>;
|
|
3
|
-
export declare function getCalculatedProps(
|
|
3
|
+
export declare function getCalculatedProps(initialProps: any, childComponents: any): {
|
|
4
4
|
categories: {
|
|
5
5
|
x: any;
|
|
6
6
|
y: any;
|
package/lib/helper-methods.js
CHANGED
|
@@ -99,12 +99,13 @@ function getStyles(props) {
|
|
|
99
99
|
};
|
|
100
100
|
}
|
|
101
101
|
|
|
102
|
-
function getCalculatedProps(
|
|
103
|
-
var style = getStyles(
|
|
104
|
-
|
|
105
|
-
var
|
|
106
|
-
|
|
107
|
-
|
|
102
|
+
function getCalculatedProps(initialProps, childComponents) {
|
|
103
|
+
var style = getStyles(initialProps);
|
|
104
|
+
|
|
105
|
+
var props = _victoryCore.Helpers.modifyProps(initialProps, fallbackProps, "chart");
|
|
106
|
+
|
|
107
|
+
var horizontal = props.horizontal,
|
|
108
|
+
polar = props.polar;
|
|
108
109
|
|
|
109
110
|
var allStrings = _victoryCore.Wrapper.getStringsFromChildren(props, childComponents);
|
|
110
111
|
|
|
@@ -149,23 +150,22 @@ function getCalculatedProps(props, childComponents) {
|
|
|
149
150
|
}
|
|
150
151
|
|
|
151
152
|
function getChildren(props, childComponents, calculatedProps) {
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
var baseStyle =
|
|
153
|
+
var children = childComponents || getChildComponents(props);
|
|
154
|
+
var newCalculatedProps = calculatedProps || getCalculatedProps(props, children);
|
|
155
|
+
var baseStyle = newCalculatedProps.style.parent;
|
|
155
156
|
var height = props.height,
|
|
156
157
|
polar = props.polar,
|
|
157
158
|
theme = props.theme,
|
|
158
159
|
width = props.width;
|
|
159
|
-
var
|
|
160
|
-
|
|
161
|
-
horizontal = _calculatedProps.horizontal;
|
|
160
|
+
var origin = newCalculatedProps.origin,
|
|
161
|
+
horizontal = newCalculatedProps.horizontal;
|
|
162
162
|
var parentName = props.name || "chart";
|
|
163
|
-
return
|
|
163
|
+
return children.filter(_react.default.isValidElement).map(function (child, index) {
|
|
164
164
|
var role = child.type && child.type.role;
|
|
165
165
|
var style = Array.isArray(child.props.style) ? child.props.style : (0, _defaults2.default)({}, child.props.style, {
|
|
166
166
|
parent: baseStyle
|
|
167
167
|
});
|
|
168
|
-
var childProps = getChildProps(child, props,
|
|
168
|
+
var childProps = getChildProps(child, props, newCalculatedProps);
|
|
169
169
|
var name = child.props.name || "".concat(parentName, "-").concat(role, "-").concat(index);
|
|
170
170
|
var newProps = (0, _defaults2.default)({
|
|
171
171
|
horizontal: horizontal,
|
|
@@ -176,7 +176,7 @@ function getChildren(props, childComponents, calculatedProps) {
|
|
|
176
176
|
style: style,
|
|
177
177
|
name: name,
|
|
178
178
|
origin: polar ? origin : undefined,
|
|
179
|
-
padding:
|
|
179
|
+
padding: newCalculatedProps.padding,
|
|
180
180
|
key: "".concat(name, "-key-").concat(index),
|
|
181
181
|
standalone: false
|
|
182
182
|
}, childProps);
|
|
@@ -206,11 +206,11 @@ var getChildComponents = function (props, defaultAxes) {
|
|
|
206
206
|
exports.getChildComponents = getChildComponents;
|
|
207
207
|
|
|
208
208
|
var getDomain = function (props, axis, childComponents) {
|
|
209
|
-
|
|
209
|
+
var children = childComponents || _react.default.Children.toArray(props.children);
|
|
210
210
|
|
|
211
|
-
var domain = _victoryCore.Wrapper.getDomain(props, axis,
|
|
211
|
+
var domain = _victoryCore.Wrapper.getDomain(props, axis, children);
|
|
212
212
|
|
|
213
|
-
var axisComponent = _victoryCore.Axis.getAxisComponent(
|
|
213
|
+
var axisComponent = _victoryCore.Axis.getAxisComponent(children, axis);
|
|
214
214
|
|
|
215
215
|
var invertDomain = axisComponent && axisComponent.props && axisComponent.props.invertAxis;
|
|
216
216
|
return invertDomain ? domain.concat().reverse() : domain;
|
package/lib/victory-chart.js
CHANGED
|
@@ -61,7 +61,10 @@ var defaultProps = {
|
|
|
61
61
|
};
|
|
62
62
|
|
|
63
63
|
var VictoryChartImpl = function (initialProps) {
|
|
64
|
-
|
|
64
|
+
var propsWithDefaults = _react.default.useMemo(function () {
|
|
65
|
+
return _objectSpread(_objectSpread({}, defaultProps), initialProps);
|
|
66
|
+
}, [initialProps]);
|
|
67
|
+
|
|
65
68
|
var role = "chart";
|
|
66
69
|
|
|
67
70
|
var _Hooks$useAnimationSt = _victoryCore.Hooks.useAnimationState(),
|
|
@@ -69,7 +72,7 @@ var VictoryChartImpl = function (initialProps) {
|
|
|
69
72
|
setAnimationState = _Hooks$useAnimationSt.setAnimationState,
|
|
70
73
|
getProps = _Hooks$useAnimationSt.getProps;
|
|
71
74
|
|
|
72
|
-
var props = getProps(
|
|
75
|
+
var props = getProps(propsWithDefaults);
|
|
73
76
|
|
|
74
77
|
var modifiedProps = _victoryCore.Helpers.modifyProps(props, fallbackProps, role);
|
|
75
78
|
|
|
@@ -142,27 +145,27 @@ var VictoryChartImpl = function (initialProps) {
|
|
|
142
145
|
|
|
143
146
|
var container = _react.default.useMemo(function () {
|
|
144
147
|
if (standalone) {
|
|
145
|
-
var defaultContainerProps = (0, _defaults2.default)({}, containerComponent.props, containerProps, _victoryCore.UserProps.getSafeUserProps(
|
|
148
|
+
var defaultContainerProps = (0, _defaults2.default)({}, containerComponent.props, containerProps, _victoryCore.UserProps.getSafeUserProps(propsWithDefaults));
|
|
146
149
|
return /*#__PURE__*/_react.default.cloneElement(containerComponent, defaultContainerProps);
|
|
147
150
|
}
|
|
148
151
|
|
|
149
152
|
return groupComponent;
|
|
150
|
-
}, [groupComponent, standalone, containerComponent, containerProps,
|
|
153
|
+
}, [groupComponent, standalone, containerComponent, containerProps, propsWithDefaults]);
|
|
151
154
|
|
|
152
155
|
var events = _react.default.useMemo(function () {
|
|
153
156
|
return _victoryCore.Wrapper.getAllEvents(props);
|
|
154
157
|
}, [props]);
|
|
155
158
|
|
|
156
|
-
var previousProps = _victoryCore.Hooks.usePreviousProps(
|
|
159
|
+
var previousProps = _victoryCore.Hooks.usePreviousProps(propsWithDefaults);
|
|
157
160
|
|
|
158
161
|
_react.default.useEffect(function () {
|
|
159
162
|
// This is called before dismount to keep state in sync
|
|
160
163
|
return function () {
|
|
161
|
-
if (
|
|
162
|
-
setAnimationState(previousProps,
|
|
164
|
+
if (propsWithDefaults.animate) {
|
|
165
|
+
setAnimationState(previousProps, propsWithDefaults);
|
|
163
166
|
}
|
|
164
167
|
};
|
|
165
|
-
}, [setAnimationState, previousProps,
|
|
168
|
+
}, [setAnimationState, previousProps, propsWithDefaults]);
|
|
166
169
|
|
|
167
170
|
if (!(0, _isEmpty2.default)(events)) {
|
|
168
171
|
return /*#__PURE__*/_react.default.createElement(_victorySharedEvents.VictorySharedEvents, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "victory-chart",
|
|
3
|
-
"version": "36.8.
|
|
3
|
+
"version": "36.8.3",
|
|
4
4
|
"description": "Chart Component for Victory",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"data visualization",
|
|
@@ -23,10 +23,10 @@
|
|
|
23
23
|
"lodash": "^4.17.19",
|
|
24
24
|
"prop-types": "^15.8.1",
|
|
25
25
|
"react-fast-compare": "^3.2.0",
|
|
26
|
-
"victory-axis": "^36.8.
|
|
27
|
-
"victory-core": "^36.8.
|
|
28
|
-
"victory-polar-axis": "^36.8.
|
|
29
|
-
"victory-shared-events": "^36.8.
|
|
26
|
+
"victory-axis": "^36.8.3",
|
|
27
|
+
"victory-core": "^36.8.3",
|
|
28
|
+
"victory-polar-axis": "^36.8.3",
|
|
29
|
+
"victory-shared-events": "^36.8.3"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
32
|
"react": ">=16.6.0"
|
package/src/helper-methods.tsx
CHANGED
|
@@ -82,9 +82,9 @@ function getStyles(props) {
|
|
|
82
82
|
};
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
-
export function getCalculatedProps(
|
|
86
|
-
const style = getStyles(
|
|
87
|
-
props = Helpers.modifyProps(
|
|
85
|
+
export function getCalculatedProps(initialProps, childComponents) {
|
|
86
|
+
const style = getStyles(initialProps);
|
|
87
|
+
const props = Helpers.modifyProps(initialProps, fallbackProps, "chart");
|
|
88
88
|
const { horizontal, polar } = props;
|
|
89
89
|
const allStrings = Wrapper.getStringsFromChildren(props, childComponents);
|
|
90
90
|
const categories = Wrapper.getCategories(props, childComponents, allStrings);
|
|
@@ -125,20 +125,20 @@ export function getCalculatedProps(props, childComponents) {
|
|
|
125
125
|
}
|
|
126
126
|
|
|
127
127
|
export function getChildren(props, childComponents, calculatedProps) {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
calculatedProps || getCalculatedProps(props,
|
|
131
|
-
const baseStyle =
|
|
128
|
+
const children = childComponents || getChildComponents(props);
|
|
129
|
+
const newCalculatedProps =
|
|
130
|
+
calculatedProps || getCalculatedProps(props, children);
|
|
131
|
+
const baseStyle = newCalculatedProps.style.parent;
|
|
132
132
|
const { height, polar, theme, width } = props;
|
|
133
|
-
const { origin, horizontal } =
|
|
133
|
+
const { origin, horizontal } = newCalculatedProps;
|
|
134
134
|
const parentName = props.name || "chart";
|
|
135
135
|
|
|
136
|
-
return
|
|
136
|
+
return children.filter(React.isValidElement).map((child, index) => {
|
|
137
137
|
const role = child.type && child.type.role;
|
|
138
138
|
const style = Array.isArray(child.props.style)
|
|
139
139
|
? child.props.style
|
|
140
140
|
: defaults({}, child.props.style, { parent: baseStyle });
|
|
141
|
-
const childProps = getChildProps(child, props,
|
|
141
|
+
const childProps = getChildProps(child, props, newCalculatedProps);
|
|
142
142
|
const name = child.props.name || `${parentName}-${role}-${index}`;
|
|
143
143
|
const newProps = defaults(
|
|
144
144
|
{
|
|
@@ -150,7 +150,7 @@ export function getChildren(props, childComponents, calculatedProps) {
|
|
|
150
150
|
style,
|
|
151
151
|
name,
|
|
152
152
|
origin: polar ? origin : undefined,
|
|
153
|
-
padding:
|
|
153
|
+
padding: newCalculatedProps.padding,
|
|
154
154
|
key: `${name}-key-${index}`,
|
|
155
155
|
standalone: false,
|
|
156
156
|
},
|
|
@@ -193,9 +193,9 @@ export const getChildComponents = (props, defaultAxes?) => {
|
|
|
193
193
|
};
|
|
194
194
|
|
|
195
195
|
const getDomain = (props, axis, childComponents) => {
|
|
196
|
-
|
|
197
|
-
const domain = Wrapper.getDomain(props, axis,
|
|
198
|
-
const axisComponent = Axis.getAxisComponent(
|
|
196
|
+
const children = childComponents || React.Children.toArray(props.children);
|
|
197
|
+
const domain = Wrapper.getDomain(props, axis, children);
|
|
198
|
+
const axisComponent = Axis.getAxisComponent(children, axis);
|
|
199
199
|
const invertDomain =
|
|
200
200
|
axisComponent && axisComponent.props && axisComponent.props.invertAxis;
|
|
201
201
|
return invertDomain ? domain.concat().reverse() : domain;
|
package/src/victory-chart.tsx
CHANGED
|
@@ -53,11 +53,14 @@ const defaultProps = {
|
|
|
53
53
|
};
|
|
54
54
|
|
|
55
55
|
const VictoryChartImpl: React.FC<VictoryChartProps> = (initialProps) => {
|
|
56
|
-
|
|
56
|
+
const propsWithDefaults = React.useMemo(
|
|
57
|
+
() => ({ ...defaultProps, ...initialProps }),
|
|
58
|
+
[initialProps],
|
|
59
|
+
);
|
|
57
60
|
const role = "chart";
|
|
58
61
|
const { getAnimationProps, setAnimationState, getProps } =
|
|
59
62
|
Hooks.useAnimationState();
|
|
60
|
-
const props = getProps(
|
|
63
|
+
const props = getProps(propsWithDefaults);
|
|
61
64
|
|
|
62
65
|
const modifiedProps = Helpers.modifyProps(props, fallbackProps, role);
|
|
63
66
|
const {
|
|
@@ -154,7 +157,7 @@ const VictoryChartImpl: React.FC<VictoryChartProps> = (initialProps) => {
|
|
|
154
157
|
{},
|
|
155
158
|
containerComponent.props,
|
|
156
159
|
containerProps,
|
|
157
|
-
UserProps.getSafeUserProps(
|
|
160
|
+
UserProps.getSafeUserProps(propsWithDefaults),
|
|
158
161
|
);
|
|
159
162
|
return React.cloneElement(containerComponent, defaultContainerProps);
|
|
160
163
|
}
|
|
@@ -164,23 +167,23 @@ const VictoryChartImpl: React.FC<VictoryChartProps> = (initialProps) => {
|
|
|
164
167
|
standalone,
|
|
165
168
|
containerComponent,
|
|
166
169
|
containerProps,
|
|
167
|
-
|
|
170
|
+
propsWithDefaults,
|
|
168
171
|
]);
|
|
169
172
|
|
|
170
173
|
const events = React.useMemo(() => {
|
|
171
174
|
return Wrapper.getAllEvents(props);
|
|
172
175
|
}, [props]);
|
|
173
176
|
|
|
174
|
-
const previousProps = Hooks.usePreviousProps(
|
|
177
|
+
const previousProps = Hooks.usePreviousProps(propsWithDefaults);
|
|
175
178
|
|
|
176
179
|
React.useEffect(() => {
|
|
177
180
|
// This is called before dismount to keep state in sync
|
|
178
181
|
return () => {
|
|
179
|
-
if (
|
|
180
|
-
setAnimationState(previousProps,
|
|
182
|
+
if (propsWithDefaults.animate) {
|
|
183
|
+
setAnimationState(previousProps, propsWithDefaults);
|
|
181
184
|
}
|
|
182
185
|
};
|
|
183
|
-
}, [setAnimationState, previousProps,
|
|
186
|
+
}, [setAnimationState, previousProps, propsWithDefaults]);
|
|
184
187
|
|
|
185
188
|
if (!isEmpty(events)) {
|
|
186
189
|
return (
|