@@ -66,7 +66,7 @@ export default (componentName, localTheme, options = {}) => (ThemedComponent) =>
66
66
67
67
getTheme ( ) {
68
68
return this . props . composeTheme === COMPOSE_SOFTLY
69
- ? Object . assign ( { } , this . getContextTheme ( ) , localTheme , this . getNamespacedTheme ( ) )
69
+ ? { ... this . getContextTheme ( ) , ... localTheme , ... this . getNamespacedTheme ( ) }
70
70
: themeable ( themeable ( this . getContextTheme ( ) , localTheme ) , this . getNamespacedTheme ( ) )
71
71
}
72
72
@@ -98,9 +98,8 @@ export default (componentName, localTheme, options = {}) => (ThemedComponent) =>
98
98
99
99
export function themeable ( style = { } , theme ) {
100
100
if ( ! theme ) return style
101
- return Object . keys ( theme ) . reduce ( ( result , key ) => (
102
- Object . assign ( result , { [ key ] : `${ style [ key ] } ${ theme [ key ] } ` } )
103
- ) , Object . assign ( { } , style ) )
101
+ return Object . keys ( theme ) . reduce ( ( result , key ) =>
102
+ ( { ...result , [ key ] : `${ style [ key ] } ${ theme [ key ] } ` } ) , style )
104
103
}
105
104
106
105
function validateComposeOption ( composeTheme ) {
@@ -114,6 +113,6 @@ function validateComposeOption(composeTheme) {
114
113
}
115
114
116
115
function removeNamespace ( key , themeNamespace ) {
117
- const capitilized = key . substr ( themeNamespace . length )
118
- return capitilized . slice ( 0 , 1 ) . toLowerCase ( ) + capitilized . slice ( 1 )
116
+ const capitalized = key . substr ( themeNamespace . length )
117
+ return capitalized . slice ( 0 , 1 ) . toLowerCase ( ) + capitalized . slice ( 1 )
119
118
}
0 commit comments