Teaching Redux

2019-05-16softwarejavascriptreduxreactreact-native

Background

I’ve been tasked with doing a course to introduce redux at my college. I have 4 days of classes to introduce redux to my lab partners and freshman alike, applying its concepts in a pratical manner to react

But why

The first question that pops in my head is why learn redux, when to use redux and more importantly when not to use redux.

Redux is a state management tool that makes you think of state in a way that makes it predictable, debuggable and testable, it’s widely used on the industry, has lot of amazing tutorials and a wide range of complimentary libraries.

It’s stable, well maintained and in my opinion a joy to work with after the initial learning curve. I you are interested in React (or React Native) give a try at learning redux and see if it’s way of thinking about state helps you build better application and manage its state in a better, simpler manner.

Redux is a tool to manage state not something every react application should use or needs to use. To quote Dan Abramov,one of the creators of Redux:

I would like to amend this: don't use Redux until you have problems with vanilla React.

Not all projects are big enough to justify redux and there are alternatives, including react own Context API. So when thinking about using redux try to think first if you need it since your application logic will rest inside it and changing it later might be time-consuming.

What is essential

After some thinking and research about what should i essential and what is not i’ve come to a simple list of concepts that are core to redux:

Closing up

With that list in mind the challenge to find something that is feasible to build in 16 hours of class begins. This is a short intro that will start a series of posts about building the app that will be used on the class alongside the tutorials on how to use redux and it’s libraries with a focus on begginer usage.