reactjs / reactjs/react.dev

[Bug]: Browser back button not working properly when navigating from /learn to main page

未關閉
#8,021 5 則留言 1 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

bug: unconfirmed
主要語言
JavaScript
星號
11.8k
分支
7.9k
平均合併
1 天 11 小時
30 天內合併 PR
11

描述

Summary

Problem: When navigating from http://localhost:3000/learn to a specific learning page (like Quick Start), clicking the browser's back button does not return to the main page at http://localhost:3000/ .

Steps to Reproduce:

  1. Go to http://localhost:3000/learn
  2. Click on "Quick Start" (or any other learning section)
  3. Click the browser's back button
  4. Expected: Should return to http://localhost:3000/
  5. Actual: Does not navigate back to main page

Browser: Chrome

Page

http://localhost:3000/learn

Details

Additional Context: This appears to be a navigation history issue where the browser's back button functionality is not working as expected when moving between the main page and learning sections. The issue might be related to how Next.js handles client-side routing in the learning section.

Possible Related Issues:

  • Similar to the fragment link back button issue that was recently fixed
  • May involve scroll restoration or navigation state management

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

先在 Chrome 中重現從 /learn 到 Quick Start 再返回主頁的流程。接著檢查學習區段使用 Next.js 的用戶端路由,並將其與最近修正的片段連結導覽進行比較。完成的標準是:瀏覽器的上一頁按鈕能夠如預期從學習頁面返回 http://localhost:3000/。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
javascript, next.js
領域
frontend, web-dev
Issue 類型
缺陷
難度
3/5
預估耗時
1-2 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
42/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。