import React from "react";
import transitionStyles from "./transition-styles";
import { CSSTransition } from "react-transition-group";
import { ENTER_TIMEOUT, EXIT_TIMEOUT } from "./container";
import useSheet from "react-jss";

const timeout = { enter: ENTER_TIMEOUT, exit: EXIT_TIMEOUT };

const AlertTransition = ({ sheet: { classes }, ...props }) =>
	props && props.children ? (
		<CSSTransition
			timeout={timeout}
			classNames={classes}
			onExited={props.onExited}
		>
			{props.children}
		</CSSTransition>
	) : null;

export default useSheet(transitionStyles)(AlertTransition);

import React from "react";
import transitionStyles from "./transition-styles";
import { CSSTransition } from "react-transition-group";
import { ENTER_TIMEOUT, EXIT_TIMEOUT } from "./container";
import useSheet from "react-jss";

const timeout = { enter: ENTER_TIMEOUT, exit: EXIT_TIMEOUT };

const AlertTransition = ({ sheet: { classes }, ...props }) => {
	delete props.classes; // if it is there (it may not be depending on which version of JSS is used)
	return <CSSTransition timeout={timeout} classNames={classes} {...props} />;
};

export default useSheet(transitionStyles)(AlertTransition);

Fix broken dismissing of alerts
Fix broken dismissing of alerts

This fixes #41 by reverting part of #40 which fixed #39. The CSSTransition needs the props passed down from the TransitionGroup. We just want to avoid passing down extraneous props to that element to avoid warnings in React v15.
