diff --git a/src/Transition.js b/src/Transition.js index c6118abc..6affcec4 100644 --- a/src/Transition.js +++ b/src/Transition.js @@ -303,7 +303,21 @@ class Transition extends React.Component { } const {children, ...childProps} = this.props; - Object.keys(Transition.propTypes).forEach(key => delete childProps[key]); + // filter props for Transtition + delete childProps.in; + delete childProps.mountOnEnter; + delete childProps.unmountOnExit; + delete childProps.appear; + delete childProps.enter; + delete childProps.exit; + delete childProps.timeout; + delete childProps.addEndListener; + delete childProps.onEnter; + delete childProps.onEntering; + delete childProps.onEntered; + delete childProps.onExit; + delete childProps.onExiting; + delete childProps.onExited; if (typeof children === 'function') { return children(status, childProps) diff --git a/test/Transition-test.js b/test/Transition-test.js index 37c7957b..d0be7c18 100644 --- a/test/Transition-test.js +++ b/test/Transition-test.js @@ -55,6 +55,40 @@ describe('Transition', () => { .render(); }); + it('should pass filtered props to children', () => { + class Child extends React.Component { + render() { + return