@@ -27,8 +27,8 @@ const THEMR_CONFIG = typeof Symbol !== 'undefined' ?
2727/**
2828 * Themr decorator
2929 * @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
3232 * @returns {function(ThemedComponent:Function):Function } - ThemedComponent
3333 */
3434export default ( componentName , localTheme , options = { } ) => ( ThemedComponent ) => {
@@ -46,6 +46,9 @@ export default (componentName, localTheme, options = {}) => (ThemedComponent) =>
4646 localTheme
4747 }
4848
49+ /**
50+ * @property {{wrappedInstance: *} } refs
51+ */
4952 class Themed extends Component {
5053 static displayName = `Themed${ ThemedComponent . name } ` ;
5154
@@ -134,16 +137,19 @@ export default (componentName, localTheme, options = {}) => (ThemedComponent) =>
134137
135138 render ( ) {
136139 let renderedElement
140+ //exclude themr-only props
141+ //noinspection JSUnusedLocalSymbols
142+ const { composeTheme, themeNamespace, ...props } = this . props //eslint-disable-line no-unused-vars
137143
138144 if ( optionWithRef ) {
139145 renderedElement = React . createElement ( ThemedComponent , {
140- ...this . props ,
146+ ...props ,
141147 ref : 'wrappedInstance' ,
142148 theme : this . theme_
143149 } )
144150 } else {
145151 renderedElement = React . createElement ( ThemedComponent , {
146- ...this . props ,
152+ ...props ,
147153 theme : this . theme_
148154 } )
149155 }
@@ -159,8 +165,8 @@ export default (componentName, localTheme, options = {}) => (ThemedComponent) =>
159165
160166/**
161167 * 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
164170 * @returns {TReactCSSThemrTheme } - Merged resulting theme
165171 */
166172export function themeable ( original = { } , mixin ) {
0 commit comments