Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove warning about deprecated findDOMNode usage #537

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/Transition.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import PropTypes from 'prop-types'
import React from 'react'
import ReactDOM from 'react-dom'

import config from './config'
import { timeoutsShape } from './utils/PropTypes'
Expand Down Expand Up @@ -117,6 +116,7 @@ class Transition extends React.Component {
let initialStatus

this.appearStatus = null
this.ref = React.createRef();

if (props.in) {
if (appear) {
Expand Down Expand Up @@ -210,7 +210,7 @@ class Transition extends React.Component {
if (nextStatus !== null) {
// nextStatus will always be ENTERING or EXITING.
this.cancelNextCallback()
const node = ReactDOM.findDOMNode(this)
const node = this.ref;

if (nextStatus === ENTERING) {
this.performEnter(node, mounting)
Expand Down Expand Up @@ -362,7 +362,7 @@ class Transition extends React.Component {
const child = React.Children.only(children)
return (
// allows for nested Transitions
<TransitionGroupContext.Provider value={null}>
<TransitionGroupContext.Provider value={{ ref: this.ref }}>
{React.cloneElement(child, childProps)}
</TransitionGroupContext.Provider>
)
Expand Down