@@ -84,7 +84,7 @@ export default (componentName, localTheme, options = {}) => ThemedComponent => {
84
84
85
85
constructor ( ...args ) {
86
86
super ( ...args )
87
- this . theme_ = this . calcTheme ( )
87
+ this . theme_ = this . calcTheme ( this . props )
88
88
}
89
89
90
90
getWrappedInstance ( ) {
@@ -97,8 +97,8 @@ export default (componentName, localTheme, options = {}) => ThemedComponent => {
97
97
return this . refs . wrappedInstance
98
98
}
99
99
100
- getNamespacedTheme ( ) {
101
- const { themeNamespace, theme } = this . props
100
+ getNamespacedTheme ( props ) {
101
+ const { themeNamespace, theme } = props
102
102
if ( ! themeNamespace ) return theme
103
103
104
104
if ( themeNamespace && ! theme ) {
@@ -119,9 +119,9 @@ export default (componentName, localTheme, options = {}) => ThemedComponent => {
119
119
)
120
120
}
121
121
122
- getThemeNotComposed ( ) {
123
- const { theme } = this . props
124
- if ( theme ) return this . getNamespacedTheme ( )
122
+ getThemeNotComposed ( props ) {
123
+ const { theme } = props
124
+ if ( theme ) return this . getNamespacedTheme ( props )
125
125
if ( config . localTheme ) return config . localTheme
126
126
return this . getContextTheme ( )
127
127
}
@@ -132,23 +132,23 @@ export default (componentName, localTheme, options = {}) => ThemedComponent => {
132
132
: { }
133
133
}
134
134
135
- getTheme ( ) {
136
- const { composeTheme } = this . props
135
+ getTheme ( props ) {
136
+ const { composeTheme } = props
137
137
return composeTheme === COMPOSE_SOFTLY
138
138
? {
139
139
...this . getContextTheme ( ) ,
140
140
...config . localTheme ,
141
- ...this . getNamespacedTheme ( )
141
+ ...this . getNamespacedTheme ( props )
142
142
}
143
143
: themeable (
144
144
themeable ( this . getContextTheme ( ) , config . localTheme ) ,
145
- this . getNamespacedTheme ( )
145
+ this . getNamespacedTheme ( props )
146
146
)
147
147
}
148
148
149
- calcTheme ( ) {
150
- const { composeTheme } = this . props
151
- return composeTheme ? this . getTheme ( ) : this . getThemeNotComposed ( )
149
+ calcTheme ( props ) {
150
+ const { composeTheme } = props
151
+ return composeTheme ? this . getTheme ( props ) : this . getThemeNotComposed ( props )
152
152
}
153
153
154
154
shouldComponentUpdate ( nextProps ) {
@@ -158,7 +158,7 @@ export default (componentName, localTheme, options = {}) => ThemedComponent => {
158
158
theme !== nextProps . theme ||
159
159
themeNamespace !== nextProps . themeNamespace
160
160
) {
161
- this . theme_ = this . calcTheme ( )
161
+ this . theme_ = this . calcTheme ( nextProps )
162
162
}
163
163
return true
164
164
}
0 commit comments