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 4848 "dependencies" : {
4949 "@babel/runtime" : " ^7.11.1" ,
5050 "classnames" : " ^2.2.1" ,
51- "rc-util" : " ^5.43 .0"
51+ "rc-util" : " ^5.44 .0"
5252 },
5353 "devDependencies" : {
5454 "@rc-component/father-plugin" : " ^1.0.1" ,
Original file line number Diff line number Diff line change 11/* eslint-disable react/default-props-match-prop-types, react/no-multi-comp, react/prop-types */
22import classNames from 'classnames' ;
33import 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' ;
55import * as React from 'react' ;
66import { useRef } from 'react' ;
77import { Context } from './context' ;
@@ -233,12 +233,15 @@ export function genCSSMotion(config: CSSMotionConfig) {
233233
234234 // Auto inject ref if child node not have `ref` props
235235 if ( React . isValidElement ( motionChildren ) && supportRef ( motionChildren ) ) {
236- const { ref : originNodeRef } = motionChildren as any ;
236+ const originNodeRef = getNodeRef ( motionChildren ) ;
237237
238238 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+ ) ;
242245 }
243246 }
244247
You can’t perform that action at this time.
0 commit comments