Skip to content
This repository has been archived by the owner on Jul 4, 2019. It is now read-only.

Commit

Permalink
Use getBoundingClientRect in Grid
Browse files Browse the repository at this point in the history
  • Loading branch information
jxnblk committed Feb 29, 2016
1 parent 68bdfcb commit ed01668
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Grid.js
Expand Up @@ -22,7 +22,7 @@ class Grid extends React.Component {

updateWidth () {
const el = this.refs.root
const width = el.offsetWidth
const { width } = el.getBoundingClientRect()
this.setState({ width })
}

Expand Down Expand Up @@ -117,7 +117,9 @@ class Grid extends React.Component {
})

return (
<div ref='root' style={style}>
<div
ref='root'
style={style}>
{modifiedChildren}
</div>
)
Expand Down

0 comments on commit ed01668

Please sign in to comment.