Leonard-Li777 / antd-table-infinity

An infinite scroll component based on antd-table that supports virtual scrolling
Other
284 stars 47 forks source link

This doesn't work on next.js #16

Open techandmedia opened 5 years ago

techandmedia commented 5 years ago

Using the latest version of React, React-DOM and nextjs "react": "^16.9.0", "react-dom": "^16.9.0", "next": "^9.0.3",

Throwing an error: "ReferenceError: window is not defined"

Nextjs already provide a guideline of how to make it works: https://github.com/zeit/next.js/wiki/FAQ

Not sure how to make it work though,

ayushkhanduri commented 4 years ago

yup , i also encountered that issue , the no-ssr plugin is not working , well the main reason is that it uses intersection-observer and the first thing that intersection observer does is that it checks if it's instance has been created and attached to the global object . It happens before the componentdidmount cycle for the component. Just importing that file causes the application to crash . I don't think that even the workarounds are worth it.

thanglong134 commented 4 years ago

Is there any way to solve this problem?

bconnorwhite commented 4 years ago

SSR should be fixed with https://github.com/Leonard-Li777/antd-table-infinity/pull/28.

tamert commented 4 years ago

ReferenceError: window is not defined

sagarj521 commented 1 year ago

this is still not working with nexjs is there any workaround for it?

ManojShivaramAithal commented 1 year ago

ReferenceError: window is not defined : Any Solution for this ?, Thanks in advance.