Skip to content

Commit 25cce9f

Browse files
committed
filter themr props
1 parent 3c91ccc commit 25cce9f

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/components/themr.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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
}

0 commit comments

Comments
 (0)