@@ -27,8 +27,8 @@ const THEMR_CONFIG = typeof Symbol !== 'undefined' ?
27
27
/**
28
28
* Themr decorator
29
29
* @param {String|Number|Symbol } componentName - Component name
30
- * @param {TReactCSSThemrTheme } localTheme - Base theme
31
- * @param {{} } options - Themr options
30
+ * @param {TReactCSSThemrTheme } [ localTheme] - Base theme
31
+ * @param {{} } [ options] - Themr options
32
32
* @returns {function(ThemedComponent:Function):Function } - ThemedComponent
33
33
*/
34
34
export default ( componentName , localTheme , options = { } ) => ( ThemedComponent ) => {
@@ -46,6 +46,9 @@ export default (componentName, localTheme, options = {}) => (ThemedComponent) =>
46
46
localTheme
47
47
}
48
48
49
+ /**
50
+ * @property {{wrappedInstance: *} } refs
51
+ */
49
52
class Themed extends Component {
50
53
static displayName = `Themed${ ThemedComponent . name } ` ;
51
54
@@ -134,16 +137,19 @@ export default (componentName, localTheme, options = {}) => (ThemedComponent) =>
134
137
135
138
render ( ) {
136
139
let renderedElement
140
+ //exclude themr-only props
141
+ //noinspection JSUnusedLocalSymbols
142
+ const { composeTheme, themeNamespace, ...props } = this . props //eslint-disable-line no-unused-vars
137
143
138
144
if ( optionWithRef ) {
139
145
renderedElement = React . createElement ( ThemedComponent , {
140
- ...this . props ,
146
+ ...props ,
141
147
ref : 'wrappedInstance' ,
142
148
theme : this . theme_
143
149
} )
144
150
} else {
145
151
renderedElement = React . createElement ( ThemedComponent , {
146
- ...this . props ,
152
+ ...props ,
147
153
theme : this . theme_
148
154
} )
149
155
}
@@ -159,8 +165,8 @@ export default (componentName, localTheme, options = {}) => (ThemedComponent) =>
159
165
160
166
/**
161
167
* Merges two themes by concatenating values with the same keys
162
- * @param {TReactCSSThemrTheme } original - Original theme object
163
- * @param {TReactCSSThemrTheme } mixin - Mixing theme object
168
+ * @param {TReactCSSThemrTheme } [ original] - Original theme object
169
+ * @param {TReactCSSThemrTheme } [ mixin] - Mixing theme object
164
170
* @returns {TReactCSSThemrTheme } - Merged resulting theme
165
171
*/
166
172
export function themeable ( original = { } , mixin ) {
0 commit comments