Questions tagged [next-link]

67 questions
1
vote
1 answer

Nextjs prefetch returns 404

I've built a Next.js app that uses dynamic routing and I'm noticing some strange behavior with the prefetches. Occasionally (usually after rebuilding but not always) my app starts returning 404s for all prefetches on a given page. If I follow…
LordofX
  • 11
  • 5
0
votes
0 answers

Context data lost in NextJS dev mode

In NextJS I’m using context, everything works fine but when I navigate with next/link then the context’s data is lost. I have to fetch, set everything again. But when i create build and then check in production mode it works fine. Why? How can i…
0
votes
1 answer

Anchor links (#) not working within the same page in Next.JS app router

I have a component with the href set to #targetDiv in my Next.js app. Ideally, when a user clicks on the button/link, the page should scroll to the respective section with the id #targetDiv . But it doesn't work that way. I went through some…
0
votes
0 answers

Next.JS Link forces page reload on routing if internet connection is slow

I have a React Next.js application, and I use Next.js components for routing. Everything works just perfect, unless the internet connection is getting slow. Reproduced by throttling network in browser dev tools. If connection is slow, and you click…
0
votes
2 answers

How to send data through Link in Next/JS?

My Next version is 13.1.5. I am trying to send contact.name through the Link in my component. Whats the best way to do this? The first code of the Link is just my original code.
0
votes
1 answer

I can't use the href on my page, it gives a 404 error

It's giving this error After clicking this My code is like this: import './header.css'; import { FaHeart } from 'react-icons/fa'; import Link from 'next/link'; export default function Header() { return ( <>
behaga
  • 1
  • 1
0
votes
1 answer

NextJS Link with anchor navigates to the site's root

I'm new to NextJS, and I'm working on a page that's under a /security/ path. On the file /app/security/page.jsx I have a simple link to an anchor tag Data Storage Clicking this link will navigate to…
pfandrade
  • 2,359
  • 15
  • 25
0
votes
0 answers

NextJS13 doesn't scroll to top after redirect

I've wrote a whole code of site using but unfortunetly in NextJS 13 it doesn't scroll me to top of the page after redirect. Any ideas why? I checked documentation and there is scroll={true} as default, even if I added it doesnt work :/ I don't add…
0
votes
1 answer

How to do components wise routing in NEXT.js?

I have a sidebar which contains some tabs like profile, settings, insights now when click on one of the tab it should show particular content where routes should change but page should not be refresh. I have no idea how to do?
0
votes
0 answers

how replace Hashtag with Link in NEXTJS

I tried dangerouslySetInnerHTML but still not working it only returns an [object Object] how to use Link to replace the hashtags in string import Link from 'next/link'; export default function Home() { const text = '#sample this…
Eric
  • 1
  • 2
0
votes
1 answer

NextJS Dynamic Link for Page & Subpage

Using NextJS I Have Dynamic Pages and Dynamic SubPages. Here is Folders/Files : pages ├── [Formation] ├── index.js │ ├── [SubPage].js In index.js (Formation Page), I Create Links :
Lucas
  • 85
  • 9
0
votes
0 answers

Next/Link keeps reload in components

It is said that in next js we don't need to install react-router-dom because the path of our pages depend on the pages folder. Well, it actually works when I create button to move to another pages. But when I create components folder and create…
0
votes
3 answers

Next.js 13 routing params

Hi folks first of all i am new to react and nextjs. So i am sorry if my question is stupid. I am currently building a navigation with nextjs 13 within new the app folder. Here is my navigation component where i am building the category links with…
AndiGo
  • 1
  • 1
  • 2
0
votes
0 answers

how to replace hashtag to Link or a tag in Typography MUI

How to allow Link in Typography without using dangerouslySetInnerHTML, I'm trying to replace the hashtags with clickable URLs. Any ideas about this and what is going on and how to fix it? import { Typography } from '@mui/material' import Link from…
Eric
  • 1
  • 2