DEV Community

ConnelBLAZE
ConnelBLAZE

Posted on

Converting a site to Nextjs

Hello there, I'm new to Next and I am trying to get this template to Nextjs. But I've been stuck trying to get the:

<script>
  document.addEventListener("DOMContentLoaded", function (event) {
     masonryBuild();
  });
</script>
Enter fullscreen mode Exit fullscreen mode

At this point I don't know what to do anymore.
This is what I have:

<Script
        id="load-content"
        dangerouslySetInnerHTML={{
          __html: `document.addEventListener("DOMContentLoaded", function (event) {
            masonryBuild();
          });`,
        }}
      />
      <Script
        id="load-content2"
        dangerouslySetInnerHTML={{
          __html: `document.addEventListener("DOMContentLoaded", function (event) {
            navbarToggleSidebar();
            navActivePage();
          });`,
        }}
      />
      <Script src="/main.js" />
      <Script src="/mine.js" />
Enter fullscreen mode Exit fullscreen mode

It's supposed to work, but it's not!

Top comments (0)