Skip to content

Commit

Permalink
document not define in nodejs.
Browse files Browse the repository at this point in the history
  • Loading branch information
dramoturg authored Jul 24, 2018
1 parent ff40051 commit 2a53db5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/Scrollbar/Scrollbar.util.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ let scrollbarSize;
* @returns {*}
*/
function getScrollbarSize(scrollbarContainerClassName) {
if (!scrollbarSize) {
if (!scrollbarSize && typeof document !== 'undefined') {
fixScrollStyles(scrollbarContainerClassName);

const dummy = document.createElement('div');
Expand All @@ -60,4 +60,4 @@ function getScrollbarSize(scrollbarContainerClassName) {
return scrollbarSize;
}

export default getScrollbarSize;
export default getScrollbarSize;

0 comments on commit 2a53db5

Please sign in to comment.