-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
revision for lesson 1 and landing page #10
Merged
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import {Link} from "react-router-dom"; | ||
|
||
import profilerSettingsUrl from "./images/profiler-settings.png" | ||
import whatChangedUrl from "./images/what-changed.png" | ||
import highlightRerenders from "./images/highlight-rerenders.png" | ||
|
||
# React Render Perf | ||
|
||
The purpose of this workshop is to learn about common issues that can result | ||
react renders taking longer than expected. | ||
|
||
## Preliminaries | ||
|
||
This tutorial assumes that you have the [React Developer Tools Chrome](https://chromewebstore.google.com/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi?pli=1) extension installed. You will need | ||
to make use of the "Profiler" tab in the React DevTools to measure performance | ||
of the components in the exercises. For information on how to use "Profiler" | ||
tab see this [blog post](https://legacy.reactjs.org/blog/2018/09/10/introducing-the-react-profiler.html). | ||
|
||
<em>WARNING: The blog post is quite old and parts of the UI no longer exist</em> | ||
|
||
### Configuring React DevTools | ||
|
||
There are a couple of very helpful settings for React DevTools that you should turn on | ||
before starting the lessons. Once you've installed the React DevTools, click on the "⚛️ Profiler" | ||
tab in the Chrome DevTools. Then click on the gear icon below the "⚛️ Profiler" tab, this | ||
will open up the React DevTools setting dialog. Select the "General" tab in the dialog and | ||
enable "Highlight updates when components render". Whenever a component is rendered, it | ||
will appear with a cyan outline around it. | ||
|
||
<img src={highlightRerenders} width="500" /> | ||
|
||
Switch to the "Profiler" tab in the dialog and enable "Record why each component rendered while profiling". | ||
|
||
<img src={profilerSettingsUrl} width="500" /> | ||
|
||
After you capture a profile, you'll be able to see what triggered a component to re-render | ||
by clicking on the component in the flame chart. You can also click on the different times | ||
a component was rendered at to see what triggered different renders of the same component. | ||
|
||
<img src={whatChangedUrl} width="500" /> | ||
|
||
## Lessons | ||
|
||
1. <Link to="/react-render-perf/lesson-01">Memoizing Expensive Functional Components</Link> | ||
2. <Link to="/react-render-perf/lesson-02">Prevent React.Context from re-rendering the whole tree</Link> | ||
3. <Link to="/react-render-perf/lesson-03">Avoid using React.Context at all</Link> | ||
4. <Link to="/react-render-perf/lesson-04">Minimizing re-renders by splitting up large components</Link> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import Content from "./content.mdx"; | ||
|
||
export default function TableOfContents() { | ||
return ( | ||
<div style={{maxWidth: 800, padding: 8}}> | ||
<Content /> | ||
</div> | ||
); | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.