React + Redux = Win! β
Β
Hi, *|USERNAME|*!
As you probably know, React has many feathers in its cap. One of its biggest feathers revolves around making it easy for us to manage our app's state and keep track of all the data it is dealing with.Β This feather's largesse also highlights some rough edges, though. In more complex apps, it is very easy for our app's data to start getting out of control with an unnecessary amount of components affected for seemingly simple changes:
One solution is for us to be extra cautious and ensure we minimize the downsides of data flowing across our app. Another solution is to rely on something known as Redux. What Redux allows you to do is offload all state management to a single, centralized location known as a Store. This Store and some helpful Redux design patterns allow us to simplify how our components deal with state:
This simplification allows our React components to spend more time doing cool things as opposed to doing boring bookkeeping work involving the words PureComponent or shouldComponentUpdate! What's the catch? There really isn't one!Β You have to learn Redux and how Redux works with React. That's it. If you haven't made the plunge or just want to sample the waters, give Redux a whirl with these two tutorials:
You may find that Redux and combining it with React solves a problem you or your team has been scratching their heads on. At very least, you will have learned something really cool you can brag about with your family and friends over the holidays :P
TILL NEXT TIME!
The combination of Redux and React is one of the great programming romances of the past few years. If you haven't had a chance to play with Redux (or React), don't exit 2016 without giving them a whirl first. The tutorials under Learn React will help.
As always, before I leave you to it,Β I would love to hear from you on what you think about this newsletter. Drop by the forum topic for this and chime in, or ping me via Twitter.
Cheers,
Kirupa :-)