Skip to content

Commit b3a8300

Browse files
committed
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.
1 parent db106e3 commit b3a8300

1 file changed

Lines changed: 4 additions & 10 deletions

File tree

src/alert-transition.jsx

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,9 @@ import useSheet from "react-jss";
66

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

9-
const AlertTransition = ({ sheet: { classes }, ...props }) =>
10-
props && props.children ? (
11-
<CSSTransition
12-
timeout={timeout}
13-
classNames={classes}
14-
onExited={props.onExited}
15-
>
16-
{props.children}
17-
</CSSTransition>
18-
) : null;
9+
const AlertTransition = ({ sheet: { classes }, ...props }) => {
10+
delete props.classes; // if it is there (it may not be depending on which version of JSS is used)
11+
return <CSSTransition timeout={timeout} classNames={classes} {...props} />;
12+
};
1913

2014
export default useSheet(transitionStyles)(AlertTransition);

0 commit comments

Comments
 (0)