8000 fix: CModal: fix deprecation warning · jackkuma/coreui-react@ad88025 · GitHub
[go: up one dir, main page]

Skip to content

Commit ad88025

Browse files
committed
fix: CModal: fix deprecation warning
1 parent 14b0c52 commit ad88025

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/modal/CModal.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useState, useEffect } from 'react'
1+
import React, { useState, useEffect, useRef } from 'react'
22
import PropTypes from 'prop-types'
33
import classNames from 'classnames'
44
import { Transition } from 'react-transition-group'
@@ -75,13 +75,15 @@ const CModal = props => {
7575
'show': isOpen || fade
7676
})
7777

78+
const nodeRef = useRef(null)
7879
return (
7980
<div onClick={modalClick}>
8081
<Transition
8182
in={Boolean(isOpen)}
8283
onEntered={onEntered}
8384
onExited={onExited}
8485
timeout={fade ? 150 : 0}
86+
nodeRef={nodeRef}
8587
>
8688
{(status) => {
8789
let transitionClass = getTransitionClass(status)
@@ -95,6 +97,7 @@ const CModal = props => {
9597
role="dialog"
9698
className={classes}
9799
data-modal={true}
100+
ref={nodeRef}
98101
>
99102
<div className={dialogClasses} role="document">
100103
<div

0 commit comments

Comments
 (0)
0