Skip to content

vabruzzo/react-week-performance

Repository files navigation

React Week NYC '19: React Performance Optimization Patterns

A class on various React performance techniques

The basics

Avoiding Re-renders

The avoiding re-renders app demonstrates shouldComponentUpdate, PureComponent, React.memo, useCallback, and immer. The v2 branch has complete code with some comments.

These techniques aren't always necessary, until they are. The following posts offer some thoughts on the costs of optimization:

Immutability

While some techniques are not always necessary, being disciplined with immutability in React is always a good idea. The following posts and videos were referenced in class:

Redux and Reselect: Computing Derived Data Efficiently

The redux-reselect app demonstrates computing derived data efficiently using reselect's createSelector. The v2 branch has complete code with some comments.

While this app uses redux, the underlying ideas are not specific to it.

Lazy Loading Images

The lazy loading images app demonstrates how to use the React render prop/children as a function pattern and the intersection observer API to make a lazy loading component. This only exists on the master branch.

About

A class on various React performance techniques

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages