@douyinfe/semi-animation-react 2.10.1 → 2.10.4

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.
@@ -144,6 +144,12 @@ class Animation extends _react.PureComponent {
144
144
  forwardInstance
145
145
  } = this.props;
146
146
 
147
+ if (this.animation === null) {
148
+ // didmount/willUnmount may be called twice when React.StrictMode is true in React 18, we need to ensure that this.animation is correct
149
+ this.initAnimation();
150
+ this.bindEvents();
151
+ }
152
+
147
153
  if (typeof forwardInstance === 'function') {
148
154
  forwardInstance(this.animation);
149
155
  }
@@ -128,6 +128,12 @@ export default class Animation extends PureComponent {
128
128
  forwardInstance
129
129
  } = this.props;
130
130
 
131
+ if (this.animation === null) {
132
+ // didmount/willUnmount may be called twice when React.StrictMode is true in React 18, we need to ensure that this.animation is correct
133
+ this.initAnimation();
134
+ this.bindEvents();
135
+ }
136
+
131
137
  if (typeof forwardInstance === 'function') {
132
138
  forwardInstance(this.animation);
133
139
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@douyinfe/semi-animation-react",
3
- "version": "2.10.1",
3
+ "version": "2.10.4",
4
4
  "description": "motion library for semi-ui-react",
5
5
  "keywords": [
6
6
  "motion",
@@ -26,8 +26,8 @@
26
26
  },
27
27
  "dependencies": {
28
28
  "@babel/runtime-corejs3": "^7.15.4",
29
- "@douyinfe/semi-animation": "2.10.1",
30
- "@douyinfe/semi-animation-styled": "2.10.1",
29
+ "@douyinfe/semi-animation": "2.10.4",
30
+ "@douyinfe/semi-animation-styled": "2.10.4",
31
31
  "classnames": "^2.2.6"
32
32
  },
33
33
  "peerDependencies": {
@@ -51,5 +51,5 @@
51
51
  "prop-types": "15.7.2",
52
52
  "react-storybook-addon-props-combinations": "^1.1.0"
53
53
  },
54
- "gitHead": "1c84b585ff43db35b286e8c24f8333e4170d015c"
54
+ "gitHead": "5c0370819f1ab319ceded2fbf0c9c7a12e4f1b77"
55
55
  }