import { useEffect } from 'react';
import WOW from 'wowjs/dist/wow.js';
import React from 'react';
import '@/assets/styles/scss/main.scss';
function MyApp({ Component, pageProps }) {
useEffect(() => {
const wow = () => {
new WOW.WOW({
boxClass: 'wow', // default
animateClass: 'animated', // default
offset: 0, // default
mobile: true, // default
live: true, // default
});
};
// if (typeof window !== 'undefined') {
// return;
// }
wow.init();
wow.call(window);
}, []);
return <Component {...pageProps} />;
}
export default MyApp;
Error Below
Server Error ReferenceError: window is not defined
This error happened while generating the page. Any console logs will be displayed in the terminal window. Source wowjs/dist/wow.js (1:0) @ eval
1 | module.exports = require("wowjs/dist/wow.js"); Blockquote
Please, what am I doing wrong?