11/**
22 * @copyright © 2015, Rick Wong. All rights reserved.
33 */
4- var React = require ( "react" ) ;
5-
4+ var React = require ( "react" ) ;
5+ var assign = React . __spread ;
66var refCounter = 0 ;
77
88/**
@@ -11,11 +11,11 @@ var refCounter = 0;
1111var InlineCss = React . createClass ( {
1212 displayName : "InlineCss" ,
1313 propTypes : {
14+ namespace : React . PropTypes . string ,
1415 componentName : React . PropTypes . string ,
15- className : React . PropTypes . string ,
16- namespace : React . PropTypes . string ,
17- stylesheet : React . PropTypes . string . isRequired ,
18- wrapper : React . PropTypes . string
16+ stylesheet : React . PropTypes . string . isRequired ,
17+ className : React . PropTypes . string ,
18+ wrapper : React . PropTypes . string
1919 } ,
2020 _transformSheet : function ( stylesheet , componentName , namespace ) {
2121 return stylesheet .
@@ -30,15 +30,22 @@ var InlineCss = React.createClass({
3030 ) ;
3131 } ,
3232 render : function ( ) {
33- var componentName = this . props . componentName || "&" ;
34- var className = this . props . className ;
3533 var namespace = this . props . namespace || "InlineCss-" + refCounter ++ ;
34+ var componentName = this . props . componentName || "&" ;
3635 var stylesheet = this . _transformSheet ( this . props . stylesheet , componentName , namespace ) ;
3736 var Wrapper = this . props . wrapper || "div" ;
3837
38+ var wrapperProps = assign ( { } , this . props , {
39+ namespace : undefined ,
40+ componentName : undefined ,
41+ stylesheet : undefined ,
42+ wrapper : undefined ,
43+ id : namespace
44+ } ) ;
45+
3946 return React . createElement (
4047 Wrapper ,
41- { id : namespace , className : className } ,
48+ wrapperProps ,
4249 this . props . children ,
4350 React . createElement ( "style" , {
4451 scoped : true ,
0 commit comments