Fixed NaN warning for pre-mount CSS prop read

This commit is contained in:
Brian Vaughn
2019-02-12 21:09:33 -05:00
parent d203ebf165
commit 95b859209f
+7 -6
View File
@@ -79,12 +79,13 @@ export default function Tree(props: Props) {
[baseDepth, numElements, getElementAtIndex]
);
const itemSize = parseInt(
getComputedStyle((document.body: any)).getPropertyValue(
'--line-height-data'
),
10
);
const itemSize =
parseInt(
getComputedStyle((document.body: any)).getPropertyValue(
'--line-height-data'
),
10
) || 18;
return (
<div className={styles.Tree}>