Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ad88025

Browse filesBrowse files
committed
fix: CModal: fix deprecation warning
1 parent 14b0c52 commit ad88025
Copy full SHA for ad88025

File tree

Expand file treeCollapse file tree

1 file changed

+4
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-1
lines changed

‎src/modal/CModal.js

Copy file name to clipboardExpand all lines: src/modal/CModal.js
+4-1Lines 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)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.