File tree Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,11 @@ export default class Frame extends React.Component {
2323
2424 render ( ) {
2525 const { component } = this . props ;
26- return React . createElement ( component , this . props , this . props . children ) ;
26+ const props = { } ;
27+ Object . keys ( this . props ) . forEach ( ( k ) => {
28+ if ( Frame . propTypes [ k ] ) return ;
29+ props [ k ] = this . props [ k ] ;
30+ } ) ;
31+ return React . createElement ( component , props , this . props . children ) ;
2732 }
2833}
Original file line number Diff line number Diff line change 11import React , { PropTypes } from 'react' ;
2+ import Frame from './frame' ;
23
34const noop = ( ) => { } ;
45
@@ -67,8 +68,17 @@ export default class Keyframes extends React.Component {
6768 const frame = this . getFrame ( ) ;
6869 if ( ! frame ) return null ;
6970
70- const props = { ...this . props , ...frame . props } ;
71- return React . cloneElement ( frame , props ) ;
71+ const props = { } ;
72+ Object . keys ( this . props ) . forEach ( ( k ) => {
73+ // don't pass props which exist only on Keyframes
74+ if ( Keyframes . propTypes [ k ] && ! Frame . propTypes [ k ] ) {
75+ return ;
76+ }
77+
78+ props [ k ] = this . props [ k ] ;
79+ } ) ;
80+
81+ return React . cloneElement ( frame , { ...props , ...frame . props } ) ;
7282 }
7383
7484 requestNextFrame ( ) {
You can’t perform that action at this time.
0 commit comments