Fix optimization link pointing to legacy docs
Fixes #8089
Before inside the "Optimizing performance" deep dive, the link with text "Performance" would send us to the legacy React docs.
Clicking on "Performance" above would send us here:
The link on this legacy page for "memo: Skipping re-rendering when props are unchanged" points to the new docs. This is the same link used in this PR.
Now clicking on "Performance" navigates to here:
Additional Considerations
Despite the old docs linking to https://react.dev/reference/react/memo#skipping-re-rendering-when-props-are-unchanged, this new page is in the Reference section for memo. There doesn't seem to be a comprehensive Learn section for performance.
The closest I could find is https://react.dev/learn/react-compiler/introduction#optimizing-re-renders, which may be more appropriate considering the React Compiler is now stable. https://react.dev/reference/react/memo#skipping-re-rendering-when-props-are-unchanged still does mention the React Compiler, though only does so later down.
Topics in legacy link that are not covered in the new link
- Using the production build
- Profiling (probably needs an update with the release of the new Profiler Panel)
- Virtualization (mentioning Activity is probably related)
Topics not mentioned in either related to reducing the frequency of re-renders
Size changes
📦 Next.js Bundle Analysis for react-dev
This analysis was generated by the Next.js Bundle Analysis action. 🤖
This PR introduced no changes to the JavaScript bundle! 🙌
@stephan-noel I agree with the points mentioned by you in the Additional Considerations in your comment above.
Just commenting that I didn't forget about this, I just think it needs more input from the React team. IMHO a Learn section for performance could be useful as even the new performance tracks are kind of buried under references. There are a lot of moving parts and there is some overlap with the Async docs work.