Skip to content

Commit

Permalink
Upgrade react-transition-group to v2
Browse files Browse the repository at this point in the history
  • Loading branch information
Filipe Costa committed Jun 19, 2018
1 parent 3c29954 commit df6b476
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion examples/src/standalone.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<script src="https://unpkg.com/react-dom@15.6.1/dist/react-dom.js"></script>
<script src="https://unpkg.com/prop-types@15.5.10/prop-types.js"></script>
<script src="https://unpkg.com/aphrodite/dist/aphrodite.umd.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react-transition-group/1.1.3/react-transition-group.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react-transition-group/2.0.0/react-transition-group.js"></script>
<script src="https://unpkg.com/react-photo-gallery@6.0.13/dist/react-photo-gallery.min.js"></script>
<script src="https://rawgit.com/neptunian/react-scrolllock/master/dist/react-scrolllock.min.js"></script>
<script src="https://unpkg.com/react-images@0.5.10/dist/react-images.min.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"aphrodite": "^0.5.0",
"prop-types": "^15.6.0",
"react-scrolllock": "^2.0.1",
"react-transition-group": "^1.1.3"
"react-transition-group": "2"
},
"devDependencies": {
"babel-cli": "^6.26.0",
Expand Down
14 changes: 6 additions & 8 deletions src/components/Portal.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import PropTypes from 'prop-types';
import React, { Component } from 'react';
import { CSSTransitionGroup } from 'react-transition-group';
import { CSSTransition, TransitionGroup } from 'react-transition-group';
import { render, unmountComponentAtNode } from 'react-dom';
import PassContext from './PassContext';

Expand Down Expand Up @@ -30,13 +30,11 @@ export default class Portal extends Component {
<PassContext context={this.context}>
<div>
<style>{styles}</style>
<CSSTransitionGroup
component="div"
transitionName="fade"
transitionEnterTimeout={duration}
transitionLeaveTimeout={duration}
{...this.props}
/>
<TransitionGroup {...this.props}>
<CSSTransition timeout={{ enter: duration, exit: duration }} classNames="fade">
{this.props.children}
</CSSTransition>
</TransitionGroup>
</div>
</PassContext>,
this.portalElement
Expand Down

0 comments on commit df6b476

Please sign in to comment.