From df2f1a355aab01c698fa36a9e444470f4ea5d203 Mon Sep 17 00:00:00 2001 From: Jimmy Jia Date: Tue, 27 Oct 2015 10:32:53 -0400 Subject: [PATCH] [fixed] Don't clone children in ResponsiveEmbed --- src/ResponsiveEmbed.js | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/ResponsiveEmbed.js b/src/ResponsiveEmbed.js index bde5a3ab76..8f78d2b969 100644 --- a/src/ResponsiveEmbed.js +++ b/src/ResponsiveEmbed.js @@ -5,7 +5,7 @@ import warning from 'warning'; class ResponsiveEmbed extends React.Component { render() { - const { bsClass, className, a16by9, a4by3, ...props } = this.props; + const { bsClass, className, a16by9, a4by3, children, ...props } = this.props; warning(!(!a16by9 && !a4by3), '`a16by9` or `a4by3` attribute must be set.'); warning(!(a16by9 && a4by3), 'Either `a16by9` or `a4by3` attribute can be set. Not both.'); @@ -16,13 +16,10 @@ class ResponsiveEmbed extends React.Component { return (
- {cloneElement( - this.props.children, - { - ...props, - className: classNames(className, 'embed-responsive-item') - } - )} + {cloneElement(children, { + ...props, + className: classNames(className, 'embed-responsive-item') + })}
); }