Skip to content

Commit

Permalink
Don't mutate style object
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleAMathews committed Nov 27, 2015
1 parent 5ec3b75 commit 22ad662
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion examples/index.cjsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ React = require 'react'
ReactDOM = require('react-dom')
Examples = require './examples'

ReactDOM.render(<Examples />, document.body)
ReactDOM.render(<Examples />, document.getElementById("mount"))
1 change: 1 addition & 0 deletions examples/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
</style>
</head>
<body>
<div id="mount"></div>
<script src="./bundle.js"></script>
</body>
</html>
Expand Down
5 changes: 3 additions & 2 deletions src/index.cjsx
Original file line number Diff line number Diff line change
Expand Up @@ -149,19 +149,20 @@ module.exports = React.createClass
# If we don't do this, the header will flash into view temporarily
# while it transitions from 0 — -100%.
if @state.state isnt "unfixed"
style = objectAssign style, {
style = objectAssign {}, style, {
WebkitTransition: "all .2s ease-in-out"
MozTransition: "all .2s ease-in-out"
OTransition: "all .2s ease-in-out"
transition: "all .2s ease-in-out"
}

unless @props.disableInlineStyles
style = objectAssign style, @props.style
style = objectAssign {}, style, @props.style
else
style = @props.style

wrapperStyles = objectAssign(
{},
@props.wrapperStyle,
{height: if @state.height then @state.height}
)
Expand Down

0 comments on commit 22ad662

Please sign in to comment.