react-virtualized-sticky-tree
Advanced tools
Comparing version 2.1.0 to 2.1.1
@@ -124,4 +124,3 @@ 'use strict'; | ||
function componentWillMount() { | ||
// TODO: really? | ||
this.recomputeTree(); | ||
this.refreshCachedMetadata(this.props); | ||
} | ||
@@ -132,2 +131,11 @@ | ||
}, { | ||
key: 'hasStructureChanged', | ||
value: function () { | ||
function hasStructureChanged(newProps) { | ||
return newProps.root !== this.props.root || newProps.getChildren !== this.props.getChildren || newProps.defaultRowHeight !== this.props.defaultRowHeight; | ||
} | ||
return hasStructureChanged; | ||
}() | ||
}, { | ||
key: 'componentWillReceiveProps', | ||
@@ -137,3 +145,3 @@ value: function () { | ||
// These two properties will change when the structure changes, so we need to re-build the tree when this happens. | ||
if (newProps.root !== this.props.root || newProps.getChildren !== this.props.getChildren || newProps.defaultRowHeight !== this.props.defaultRowHeight) { | ||
if (this.hasStructureChanged(newProps)) { | ||
this.refreshCachedMetadata(newProps); | ||
@@ -416,3 +424,3 @@ } | ||
if (this.props.onRowsRendered !== undefined && prevState.currNodePos !== this.state.currNodePos) { | ||
if (this.props.onRowsRendered !== undefined && (prevState.currNodePos !== this.state.currNodePos || this.hasStructureChanged(prevProps))) { | ||
var range = this.rowRenderRange; | ||
@@ -419,0 +427,0 @@ var visibleStartInfo = this.nodePosCache[range.visibleStart]; |
@@ -124,4 +124,3 @@ 'use strict'; | ||
function componentWillMount() { | ||
// TODO: really? | ||
this.recomputeTree(); | ||
this.refreshCachedMetadata(this.props); | ||
} | ||
@@ -132,2 +131,11 @@ | ||
}, { | ||
key: 'hasStructureChanged', | ||
value: function () { | ||
function hasStructureChanged(newProps) { | ||
return newProps.root !== this.props.root || newProps.getChildren !== this.props.getChildren || newProps.defaultRowHeight !== this.props.defaultRowHeight; | ||
} | ||
return hasStructureChanged; | ||
}() | ||
}, { | ||
key: 'componentWillReceiveProps', | ||
@@ -137,3 +145,3 @@ value: function () { | ||
// These two properties will change when the structure changes, so we need to re-build the tree when this happens. | ||
if (newProps.root !== this.props.root || newProps.getChildren !== this.props.getChildren || newProps.defaultRowHeight !== this.props.defaultRowHeight) { | ||
if (this.hasStructureChanged(newProps)) { | ||
this.refreshCachedMetadata(newProps); | ||
@@ -416,3 +424,3 @@ } | ||
if (this.props.onRowsRendered !== undefined && prevState.currNodePos !== this.state.currNodePos) { | ||
if (this.props.onRowsRendered !== undefined && (prevState.currNodePos !== this.state.currNodePos || this.hasStructureChanged(prevProps))) { | ||
var range = this.rowRenderRange; | ||
@@ -419,0 +427,0 @@ var visibleStartInfo = this.nodePosCache[range.visibleStart]; |
{ | ||
"name": "react-virtualized-sticky-tree", | ||
"description": "A React component for efficiently rendering tree like structures with support for position: sticky", | ||
"version": "2.1.0", | ||
"version": "2.1.1", | ||
"author": "Marc McIntyre <marchaos@gmail.com>", | ||
@@ -6,0 +6,0 @@ "license": "MIT", |
86651
1702