diff --git a/packages/material-ui/src/Paper/Paper.test.js b/packages/material-ui/src/Paper/Paper.test.js index 9234ba53101062..661a16b859b531 100644 --- a/packages/material-ui/src/Paper/Paper.test.js +++ b/packages/material-ui/src/Paper/Paper.test.js @@ -72,9 +72,6 @@ describe('', () => { it('allows custom elevations via theme.shadows', () => { const theme = createMuiTheme(); - // Theme.shadows holds a reference to `@material-ui/core/styles#shadows` - // Mutating it causes side effects in other tests - theme.shadows = theme.shadows.slice(); theme.shadows.push('20px 20px'); const { getByTestId } = render( diff --git a/packages/material-ui/src/styles/createMuiTheme.js b/packages/material-ui/src/styles/createMuiTheme.js index 065efc098bb4ef..7f09210e54f003 100644 --- a/packages/material-ui/src/styles/createMuiTheme.js +++ b/packages/material-ui/src/styles/createMuiTheme.js @@ -30,12 +30,13 @@ function createMuiTheme(options = {}, ...args) { mixins: createMixins(breakpoints, spacing, mixinsInput), components: {}, // Inject component definitions palette, - shadows, + // Don't use [...shadows] until you've verified its transpiled code is not invoking the iterator protocol. + shadows: shadows.slice(), typography: createTypography(palette, typographyInput), spacing, - shape, + shape: { ...shape }, transitions: { duration, easing, create, getAutoHeightDuration }, - zIndex, + zIndex: { ...zIndex }, }, other, );