Routing from page 1 to page 2 and then using the browser to go back to page 1 breaks page 1
P粉033429162
P粉033429162 2023-09-14 21:00:00
0
1
411

I'm using typescript routing based on next 13.4.5 and /app.

In my page 1 I have (next/link) from which I can navigate to page 2. If I use the browser back button to go back to page 1, the entire page breaks. For example, the top section disappears and the page starts in the middle. The rest of the page's CSS doesn't work, etc.

My page 1 is completely SSR. But in page 2, I used "use client"; in page.tsx.

Share the deployment version of the above site:

  1. The homepage is page 1.
  2. The login page is page 2.

To copy, visit https://buzzli.vercel.app and press the "Start" button in the upper right corner. This is the next/link tag. It will take you to the login page. Then try to use the back button to go back to the previous page. You will see errors.

I don't know what I'm doing wrong here, so not sharing any code.

P粉033429162
P粉033429162

reply all(1)
P粉022285768

I found the problem.

Actually the problem is with the nested tags.

The project structure is like this:

/
--> layout
--> page
--> /login
    --> layout (the problem lied here)
    --> page

I mistakenly placed another html tag inside this internal layout file.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!