Skip to content

Commit b1d26e4

Browse files
Replace Object.assign with spread syntax
1 parent be0c33b commit b1d26e4

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/components/themr.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export default (componentName, localTheme, options = {}) => (ThemedComponent) =>
6464

6565
getTheme() {
6666
return this.props.composeTheme === COMPOSE_SOFTLY
67-
? Object.assign({}, this.getContextTheme(), localTheme, this.getNamespacedTheme())
67+
? { ...this.getContextTheme(), ...localTheme, ...this.getNamespacedTheme() }
6868
: themeable(themeable(this.getContextTheme(), localTheme), this.getNamespacedTheme())
6969
}
7070

@@ -96,9 +96,8 @@ export default (componentName, localTheme, options = {}) => (ThemedComponent) =>
9696

9797
export function themeable(style = {}, theme) {
9898
if (!theme) return style
99-
return Object.keys(theme).reduce((result, key) => (
100-
Object.assign(result, { [key]: `${style[key]} ${theme[key]}` })
101-
), Object.assign({}, style))
99+
return Object.keys(theme).reduce((result, key) =>
100+
({ ...result, [key]: `${style[key]} ${theme[key]}` }), style)
102101
}
103102

104103
function validateComposeOption(composeTheme) {

0 commit comments

Comments
 (0)