Fix reversed blog navigation links
Summary
Fixes the reversed "Previous" and "Next" navigation links on blog posts.
Problem
- "Previous" was pointing to newer posts
- "Next" was pointing to older posts
This behavior is counter-intuitive for blog navigation, where users expect "Previous" to go to older posts and "Next" to go to newer posts.
Solution
Swapped prevRoute and nextRoute specifically for blog posts in the Page component, since blog posts are ordered newest-to-oldest in the route tree.
Test Plan
- Navigate to any blog post (e.g., https://react.dev/blog/2025/04/23/react-labs-view-transitions-activity-and-more)
- Verify "Previous" now links to an older post
- Verify "Next" now links to a newer post
ISSUE: #7844
Size changes
📦 Next.js Bundle Analysis for react-dev
This analysis was generated by the Next.js Bundle Analysis action. 🤖
Five Pages Changed Size
The following pages changed size from the code in this PR compared to its base branch:
| Page | Size (compressed) | First Load |
|---|---|---|
/404 |
127.9 KB (🟡 +16 B) |
238.44 KB |
/500 |
127.91 KB (🟡 +16 B) |
238.45 KB |
/[[...markdownPath]] |
130.35 KB (🟡 +16 B) |
240.89 KB |
/errors |
128.16 KB (🟡 +16 B) |
238.7 KB |
/errors/[errorCode] |
128.13 KB (🟡 +16 B) |
238.67 KB |
Details
Only the gzipped size is provided here based on an expert tip.
First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.
Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis
Next to the size is how much the size has increased or decreased compared with the base branch of this PR. If this percentage has increased by 10% or more, there will be a red status indicator applied, indicating that special attention should be given to this.
This PR has the correct fix but the CLA isn't signed: https://github.com/reactjs/react.dev/pull/7850