Looking to navigate to different pages based on dropdown selection, but unsure how to do so in React and Next. "use client" import Link from 'next/link'; function Home() { return ( <main> <h1>Hello</h1> < ...
The following code snippet is causing me some trouble: <a onClick={() => { if (fortype === "user") { if (rd.track !== null) { router.push({ pathname: `/tracks/${rd.track._id}`, query: { fr ...
In my NextJS project, I have dynamic pages and dynamic subpages organized in the following folders/files structure: pages ├── [Formation] ├── index.js │ ├── [SubPage].js Within index.js (Formation Page), I create links like this: < ...
I am encountering some issues with the next/link functionality in my application. There is a reusable component that displays a button, which is used twice on the page with different URLs each time. While the button works perfectly when the page is viewe ...
Here is a snippet 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">{i ...
One of the components I've created in Next.js is a custom routing link that appends the locale before the pathname when clicked and applies a custom style for the active link. Below is the code snippet for this component: "use client"; imp ...
I am encountering an issue with the Next/Link component. The problem arises when a user reaches the product details page. On the homepage, there are 3 link components that direct users to domain.com/headphones, domain.com/earphones, or domain.com/speakers. ...
How can I ensure that the Link appears above the component I created in Next.js 11 version? I encountered this error message: Warning: Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()? ...
Currently, I'm developing an application that allows users to create posts and mention other users by using hashtags in the post. When retrieving the list of posts through an API call, the challenge arises on how to wrap these hashtags and usernames w ...