reactjs / reactjs/react.dev

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

Open
#8,021 5 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug: unconfirmed
Dominant language
JavaScript
Stars
11.8k
Forks
7.9k
Avg merge
1d 11h
Merged PRs (30d)
11

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the flow from /learn to Quick Start and back to the main page in Chrome. Then inspect the learning section's Next.js client-side routing and compare it with the recently fixed fragment-link navigation. Done means the browser back button returns from a learning page to http://localhost:3000/ as expected.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, next.js
Domain
frontend, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.