Created
January 25, 2017 19:46
-
-
Save cotyembry/55b94cdc48779e6c212006e5034e8b80 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Below is an example to incorrectly mutate the styles | |
var svgStyle = styles.svg; | |
svgStyle.width = this.state.width; | |
svgStyle.height = this.state.height; | |
// Below is a proper way to change the style that is used by cloning the style rather than mutating it | |
var svgStyle = {...styles.svg, width: this.state.width, height: this.state.height } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment