souhe / reactScrollbar

Scrollbar component for React
MIT License
466 stars 137 forks source link

ReferenceError: window is not defined again #70

Open deeppaul opened 7 years ago

deeppaul commented 7 years ago

I'm getting ReferenceError: window is not defined errors during build process on server side. Same on 0.4.0 and 0.5.0. I tried to redefine window, but it doesn't changed the situation. The errors appear even while import on this line of code return/msie [6-9]\b/.test(window.navigator.userAgent.toLowerCase())

Here is my code:

` import ScrollBar from 'react-scrollbar const ScrollArea = ({ children, props }) => { return ( <ScrollBar speed={0.2} horizontal={false} vertical={true} contentWindow={window || {}} ownerDocument={document || {}} {...props}

{children}

) } `

pavelmobstudio commented 7 years ago

I found mistake in my code. I didn't used no-css version. Everything is ok now