Skip to content

Instantly share code, notes, and snippets.

@markdalgleish
Created September 11, 2015 05:39
Show Gist options
  • Star 16 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save markdalgleish/fab73ca3ace3b9ab6077 to your computer and use it in GitHub Desktop.
Save markdalgleish/fab73ca3ace3b9ab6077 to your computer and use it in GitHub Desktop.
CSS Modules + ReactCSSTransitionGroup in React 0.14
import transitions from './transitions.css';
export default () => (
<ReactCSSTransitionGroup transitionName={transitions}>
{ ... }
</ReactCSSTransitionGroup>
);
.enter { ... }
.enterActive { ... }
.leave { ... }
.leaveActive { ... }
.appear { ... }
.appearActive { ... }
@reznord
Copy link

reznord commented Dec 28, 2016

@markdalgleish, the leave transition is not working for me for some reason !! Can you help me with that?

here is my code:

  <ReactCSSTransitionGroup transitionAppear transitionName={styles} transitionEnterTimeout={500} transitionLeaveTimeout={500} transitionAppearTimeout={500} >
        {fullscreen ? fullpage : popup}
  </ReactCSSTransitionGroup>

the css for this:

.enter {
  opacity: 0.01;

}
.enterActive {
  transition: opacity 0.3s ease-in;
  opacity: 1;
}

.leave {
  opacity: 1;

}
.leaveActive {
  transition: opacity 0.3s ease-out;
  opacity: 0.01;
}

.appear {
  opacity: 0.01;

}
.appearActive {
  transition: opacity 0.3s ease-in;
  opacity: 1;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment