File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change 48
48
"dependencies" : {
49
49
"@babel/runtime" : " ^7.11.1" ,
50
50
"classnames" : " ^2.2.1" ,
51
- "rc-util" : " ^5.43 .0"
51
+ "rc-util" : " ^5.44 .0"
52
52
},
53
53
"devDependencies" : {
54
54
"@rc-component/father-plugin" : " ^1.0.1" ,
Original file line number Diff line number Diff line change 1
1
/* eslint-disable react/default-props-match-prop-types, react/no-multi-comp, react/prop-types */
2
2
import classNames from 'classnames' ;
3
3
import findDOMNode from 'rc-util/lib/Dom/findDOMNode' ;
4
- import { fillRef , supportRef } from 'rc-util/lib/ref' ;
4
+ import { fillRef , getNodeRef , supportRef } from 'rc-util/lib/ref' ;
5
5
import * as React from 'react' ;
6
6
import { useRef } from 'react' ;
7
7
import { Context } from './context' ;
@@ -233,12 +233,15 @@ export function genCSSMotion(config: CSSMotionConfig) {
233
233
234
234
// Auto inject ref if child node not have `ref` props
235
235
if ( React . isValidElement ( motionChildren ) && supportRef ( motionChildren ) ) {
236
- const { ref : originNodeRef } = motionChildren as any ;
236
+ const originNodeRef = getNodeRef ( motionChildren ) ;
237
237
238
238
if ( ! originNodeRef ) {
239
- motionChildren = React . cloneElement < any > ( motionChildren , {
240
- ref : setNodeRef ,
241
- } ) ;
239
+ motionChildren = React . cloneElement (
240
+ motionChildren as React . ReactElement ,
241
+ {
242
+ ref : setNodeRef ,
243
+ } ,
244
+ ) ;
242
245
}
243
246
}
244
247
You can’t perform that action at this time.
0 commit comments