Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 907e59a

Browse files
committedJun 1, 2020
fix: CFade: assign nodeRef to Transition to prevent warning
1 parent 8299524 commit 907e59a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed
 

‎src/fade/CFade.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React from 'react'
1+
import React, { useRef } from 'react'
22
import PropTypes from 'prop-types'
33
import classNames from 'classnames'
44
import { pickByKeys, omitByKeys } from '@coreui/utils/src'
@@ -23,8 +23,10 @@ const CFade = props => {
2323
const transitionProps = pickByKeys(rest, TransitionPropTypeKeys)
2424
const childProps = omitByKeys(rest, TransitionPropTypeKeys)
2525

26+
const childRef = useRef()
27+
2628
return (
27-
<Transition {...transitionProps}>
29+
<Transition {...transitionProps} nodeRef={childRef}>
2830
{(status) => {
2931
const isActive = status === 'entered'
3032
const classes = classNames(

0 commit comments

Comments
 (0)
Please sign in to comment.