Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Importing issue in react js project #36

Open
saadcrest opened this issue Feb 27, 2023 · 1 comment
Open

Importing issue in react js project #36

saadcrest opened this issue Feb 27, 2023 · 1 comment

Comments

@saadcrest
Copy link

I cannot use your incredible smooth scrolling library due to errors while importing in react js project. Please guide me to implement this in my project.
Screenshot 2023-02-27 172158

@onukwilip
Copy link

It simply says that the window object is not defined and it seems like you are using Next.Js not just React.Js in your project. In Next.Js projects we call the window object a little differently.
Next.Js offeres server side rendering, which means that your site runs on the server before running on the client. There is no window object on the server (Node.Js). Therefore, try calling the window object from the useEffect Hook. Refer to this article for better explanation.
https://articles.wesionary.team/window-object-in-nextjs-1e505349c6f5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants