Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Next js window is not defined solution

var currentUrl = '';
  if (typeof window !== 'undefined') {
    currentUrl = window.location.href;
  }
  if (typeof window !== 'undefined') {
    window.onload = function afterWebPageLoad() {

      setLoading(false);
    }
  }
  setTimeout(function () {
    setLoading(false);
  }, 30000);
Source by techloset-dev.vercel.app #
 
PREVIOUS NEXT
Tagged: #Next #js #window #defined #solution
ADD COMMENT
Topic
Name
4+9 =