Skip to content

Commit

Permalink
Merge pull request #5 from pollen8/master
Browse files Browse the repository at this point in the history
implement transitionMount prop
  • Loading branch information
drcmda committed Nov 13, 2018
2 parents d8f7a9b + ea0a077 commit 5ded3b4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export class Grid extends React.PureComponent {
open: PropTypes.string,
}
state = {
mounted: false,
width: 0,
height: 0,
heightOuter: 0,
Expand All @@ -57,6 +58,7 @@ export class Grid extends React.PureComponent {
this.setState({
[width]: props.client.width,
[height]: props.client.height,
mounted: width === 'width' || this.state.mounted,
})
resizeOuter = props => this.resize('widthOuter', 'heightOuter', props)
resizeInner = props => this.resize('width', 'height', props)
Expand Down Expand Up @@ -151,8 +153,6 @@ export class Grid extends React.PureComponent {
})
const overflow = lockScroll ? (curOpen ? 'hidden' : 'auto') : 'auto'
const totalHeight = Math.max(...columnHeights) + margin
const renderContainer = widthOuter > 0 && heightOuter > 0
const renderContent = transitionMount || (height > 0 && width > 0)

return (
<Measure
Expand Down Expand Up @@ -186,7 +186,7 @@ export class Grid extends React.PureComponent {
update={this.update}
impl={impl}
config={config}
children={displayData.map(this.cell)}
children={(transitionMount || this.state.mounted) && displayData.map(this.cell)}
/>
</div>
)}
Expand Down

0 comments on commit 5ded3b4

Please sign in to comment.