maslianok / react-resize-detector

A Cross-Browser, Event-based, Element Resize Detection for React
http://maslianok.github.io/react-resize-detector/
MIT License
1.25k stars 91 forks source link

Version 6.0.1-rc.1 break in SSR page (Next Js) #116

Closed nonusae closed 3 years ago

nonusae commented 3 years ago

I used v.6.0.1-rc.1 and v6.0.1-alpha.1 in my nextJS application and got an error when navigate to page with getInitialProps.

After searching a while I found a solution in this issue. After downgrade to v.5.0.6 everything work perfectly.

I will attach the screenshoot of an error.

Screen Shot 2564-01-12 at 03 12 40
maslianok commented 3 years ago

Yeah, I see the problem.

In v6.0.0 we've removed ResizeObserver polyfill since most browser support it natively nowadays. But we have to add some additional conditions to not process it on server side.

Will be fixed in the next release

maslianok commented 3 years ago

@nonusae can you please try 6.0.1-rc.3 ?

nonusae commented 3 years ago

@maslianok Work perfectly with 6.0.1-rc.3. 🎉