0

So here I have a part of my NavBar()

        {/* Desktop Nav */}
        <div className="hidden md:flex items-center space-x-6">
          <Link href={item1Href}>
            <div className="text-lg hover:text-gray-400">{item1}</div>
          </Link>
          <Link href={item2Href}>
            <div className="text-lg hover:text-gray-400">{item2}</div>
          </Link>
          <Link href={item3Href}>
            <div className="text-lg hover:text-gray-400">{item3}</div>
          </Link>
          <Link href={item4Href}>
            <div className="text-lg hover:text-gray-400">{item4}</div>
          </Link>
          <Link href={buttonLink}>
            <button className="border-2 shadow-2xl hover:bg-white 
             hover:text-black transition duration-300 px-8 py-4">
              Residents
            </button>
          </Link>
          <Link href={buttonLink}>
            <button className="border-2 shadow-2xl hover:bg-white 
             hover:text-black transition duration-300 px-8 py-4">
              Apply Now
            </button>
          </Link>
        </div>

And here is how im using the component

      <NavBar 
        item1="Amenities" item1Href="/#amenities"
        item2="Floor Plans" item2Href="/#floorplans"
        item3="Directions" item3Href="/#directions"
        item4="Contact Us" item4Href="/contact"
      />

My problem is that {item4Href} which is "/contact" 404's. I figure it's likely because my project is set up like

  • src
    • app
      • contact.js

and not the regular pages folder but Next/Link should understand

const nextConfig = {
    pagesDir: './app',
  }

within next.config.mjs.

Recently - I just tried using the file convention

  • src
    • app
      • contact
        • contact.js

and I still got a 404

New contributor
Aeryn G is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.