Demo of shouldComponentUpdate and Immutable.js with React.
JavaScript Other
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
app
build Fix render log. Sep 22, 2015
dist
specs Initialize from react flux boilerplate. Sep 18, 2015
styles
.gitignore
README.md Link to app.js in readme. Sep 22, 2015
gulpfile.js
package.json

README.md

React and Immutable.js example

This application demonstrates how React always does a full re-render by default, and how you can change that behavior using shouldComponentUpdate and Immutable.js.

The application code is in the App.js file.

Get started:

Based on Flux React Boilerplate.

shouldComponentUpdate

If shouldComponentUpdate isn't used all components are re-rendered every time any data changes.

Using shouldComponentUpdate means we only render a component if its data has changed. Using Immutable.js allows us to determine that by using a reference comparison between the old props and the new props, we don't need to do a deep comparison of objects.

This video shows what is re-rendered on each change.