Skip to content

Commit 9736ef6

Browse files
Merge pull request #48 from ovaldi/bugfix-shouldComponentUpdate
bugfix: shouldComponentUpdate
2 parents 61ba16d + 5db224e commit 9736ef6

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/components/themr.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -151,17 +151,16 @@ export default (componentName, localTheme, options = {}) => ThemedComponent => {
151151
return composeTheme ? this.getTheme() : this.getThemeNotComposed()
152152
}
153153

154-
shouldComponentUpdate(prevProps) {
154+
shouldComponentUpdate(nextProps) {
155155
const { composeTheme, theme, themeNamespace } = this.props
156156
if (
157-
composeTheme !== prevProps.composeTheme ||
158-
theme !== prevProps.theme ||
159-
themeNamespace !== prevProps.themeNamespace
157+
composeTheme !== nextProps.composeTheme ||
158+
theme !== nextProps.theme ||
159+
themeNamespace !== nextProps.themeNamespace
160160
) {
161161
this.theme_ = this.calcTheme()
162-
return true
163162
}
164-
return false
163+
return true
165164
}
166165

167166
render() {

0 commit comments

Comments
 (0)