We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e04ab72 commit 2eb04f5Copy full SHA for 2eb04f5
package.json
@@ -2,6 +2,9 @@
2
"name": "rc-virtual-list",
3
"version": "0.0.0-rc.0",
4
"description": "React Virtual List Component",
5
+ "engines": {
6
+ "node": ">=8.x"
7
+ },
8
"keywords": [
9
"react",
10
"react-component",
src/utils/itemUtil.ts
@@ -81,7 +81,8 @@ export function getElementScrollPercentage(element: HTMLElement | null) {
81
* But if not provided, downgrade to `findDOMNode` to get the real dom element.
82
*/
83
export function getNodeHeight(node: HTMLElement) {
84
- return findDOMNode(node).offsetHeight;
+ const element = findDOMNode(node);
85
+ return element ? element.offsetHeight : 0;
86
}
87
88
/**
0 commit comments