在 nextJs 中删除 Link 的下划线

delete undeline from Link in nextJs

如何找到link

中单词下的那一行
        <Link
          style={{ textDecoration: "none", color: "white" }}
          href={`/products/${id}`}
        >
          More Details
        </Link>

首先,您需要将文本包装到 <a> </a> 标记中。根据 Next Js 文档 Docs Link。看看这段代码,希望它对你有用。

   <Link
      style={{ textDecoration: "none", color: "white" }}
      href={`/products/${id}`}
    >
     <a> More Details </a>
    </Link>

it's working in my case one more mistake in you're code is , you have to use as keyword for dynamic route

 <Link href={`/products/[id]`} as= {`/products/${id}`} > </Link>