React Course: Add React Compiler section to Refs And Memoization lesson#30879
Merged
mao-sz merged 14 commits intoTheOdinProject:mainfrom Mar 19, 2026
Merged
Conversation
Besides adding a new section about React Compiler, I also modified the existing LO items to keep in line with the style of how they should be written.
Add the React Compiler section, modify Conclusion, Knowledge check and Assignment sections.
mao-sz
requested changes
Mar 18, 2026
Co-authored-by: mao-sz <122839503+mao-sz@users.noreply.github.com>
mao-sz
requested changes
Mar 19, 2026
Contributor
mao-sz
left a comment
There was a problem hiding this comment.
Nice, pretty much what I was thinking. Last little bits below
|
|
||
| React Compiler is a relatively new build-time tool that can automatically optimize our React app. It will analyze our code and memoize appropriate components and hooks, primarily focusing on improving update performance (re-rendering existing components). This means that in most cases, we *don't have to* manually memoize components or hooks. | ||
|
|
||
| So if React Compiler memoizes our hooks and components automatically, do we need to know about `React.memo`, or hooks like `useMemo` and `useCallback`? Short answer - yes. Understanding manual memoization helps us understand what React Compiler does under the hood, not to mention that you will almost certainly run into manual memoization techniques in the existing code bases. Lastly, there will be cases where we will want to manually memoize an expensive function, or make sure a `useEffect` dependency is memoized to ensure it doesn't change unnecessarily and fire the effect. |
Contributor
There was a problem hiding this comment.
While the RC docs cover this in more detail, I think a subtle tweak like below is a little more "ah, I see" at a first read at least. What do you think?
Suggested change
| So if React Compiler memoizes our hooks and components automatically, do we need to know about `React.memo`, or hooks like `useMemo` and `useCallback`? Short answer - yes. Understanding manual memoization helps us understand what React Compiler does under the hood, not to mention that you will almost certainly run into manual memoization techniques in the existing code bases. Lastly, there will be cases where we will want to manually memoize an expensive function, or make sure a `useEffect` dependency is memoized to ensure it doesn't change unnecessarily and fire the effect. | |
| So if React Compiler memoizes our hooks and components automatically, do we need to know about `React.memo`, or hooks like `useMemo` and `useCallback`? Short answer - yes. Understanding manual memoization helps us understand what React Compiler does under the hood, not to mention that you will almost certainly run into manual memoization techniques in the existing code bases. Lastly, there may be cases where we need more control over what gets memoized and how compared to what React Compiler will automatically do, such as making sure a `useEffect` dependency is memoized to ensure it doesn't change unnecessarily and fire the effect. |
Contributor
Author
There was a problem hiding this comment.
I think it's a decent idea to say that obviously manual memoization offers us greater control over Compiler's automatic one.
I've decided to just incorporate your suggestion for the 2nd paragraph- I just kept changing it over and over again (too undecided on the exact wording)...
Co-authored-by: mao-sz <122839503+mao-sz@users.noreply.github.com>
…0/curriculum into feat/add_react_compiler_section
Co-authored-by: mao-sz <122839503+mao-sz@users.noreply.github.com>
Co-authored-by: mao-sz <122839503+mao-sz@users.noreply.github.com>
Contributor
Author
|
Thanks for the suggestions as always Mao. |
mao-sz
approved these changes
Mar 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Because
Since React Compiler has been pushed to a stable version 1.0 for some time, and the React docs on both useMemo and useCallback have a Note recommending usage of automatic memoization with React compiler, over manual memoization - it seems like a good time to introduce a short section on React Compiler to the Refs And Memoization lesson in the React Course.
This PR
Issue
Closes #30878
Additional Information
Pull Request Requirements
location of change: brief description of changeformat, e.g.Intro to HTML and CSS lesson: Fix link textBecausesection summarizes the reason for this PRThis PRsection has a bullet point list describing the changes in this PRIssuesection