79461900

Date: 2025-02-23 20:12:39
Score: 0.5
Natty:
Report link

Since NextJs 13, tags are no longer required.

I like passing props into href for easy to read and organize code. Here's an example using app router [email protected]. Use "target" and "rel" like so to open your link in a new tab.

//// Some.tsx file

.....

    <Link
      href={siteConfig.links.login}
      target="_blank"
      rel="noreferrer"
      className={buttonVariants()}
    >
      Login
    </Link>

...... ////

Heres an example site config where you create a "site" object that can accept arrays and other objects...in this case we have an object called "links" with its child "URL" objects

/config/site.ts

  links: {
    twitter: 
"https://twitter.com/r_mourey_jr",
    github: 
"https://github.com/rmourey26/onyx",
    login: "https://onyx-rho- 
            pink.vercel.app/auth",
    signup: "https://onyx-rho- 
           pink.vercel.app/onboarding",
    linkedin: "https://linkedin.com/in/robertmoureyjr",
  },

}

....

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Filler text (0.5): ...........
  • Low reputation (1):
Posted by: rmourey26