Originally published at: http://www.sitepoint.com/immutability-react/
In my previous article I wrote about the hows and whys of immutability. I argued that one area where immutability truly shines is in tracking changes, one of the big challenges in modern front-end frameworks. In this article I will give you an example of how immutability can be used with React, a library developed by Facebook.
How to use immutability in React
In my previous article, I implemented the core game logic for Minesweeper. In this article, we will take a look at the UI layer. There’s a couple of gotchas we need to account for when using immutable.js objects with React. The first one is that you cannot pass an immutable map or list directly to a React component like this:
Continue reading this article on SitePoint