Skip to content

Commit 5db224e

Browse files
Fix: Use nextProps argument in shouldComponentUpdate
The shouldComponentUpdate API defines that the arguments are nextProps and nextState. So we replace prevProps with nextProps.
1 parent 0ed8562 commit 5db224e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/components/themr.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -151,12 +151,12 @@ 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()
162162
}

0 commit comments

Comments
 (0)