AvraamMavridis/react-intersection-visible

Broken SSR

Closed this issue · 4 comments

Thanks for this component at first!
import 'intersection-observer';
breaks down SSR due it uses window object without checking for available inside of it.
Please, can you remove this import and warn this in Readme instead?
Checked at Gatsby 2 at build command.
Thanks!

We need the polyfill though, we need to find a way to achieve both.

What's the polyfill needed for? Afaik create-react-app transpiles node_modules since V2.

@Gregoor sorry I dont get it, why create-react-app is related? The polyfill is needed for browsers that do not implement the IntersectionObserver API.

@Gregoor @nickensoul in any case I will remove the import