developerdizzle / react-virtual-list

Super simple virtualized list React component
http://developerdizzle.github.io/react-virtual-list/
MIT License
619 stars 73 forks source link

[SSR] During server render, window object is not defined. #63

Closed aga5tya closed 6 years ago

aga5tya commented 6 years ago

While server rendering the list with default state, the code breaks since window object is directly referenced in the condition for check for requestAnimationFrame.

studentIvan commented 6 years ago

You can get rid of the window object in your code while SSR. (typeof window !== 'undefined')