the-road-to-learn-react/use-state-with-callback

Issue when using in Next.js 14 app router

Closed this issue · 1 comments

It's causing ReferenceError: window is not defined during build.

I guess you are using useStateWithCallbackInstant which only works on the client-side. If you get an error like "window undefined", you are doing something on the server-side where there is no window object.