This blog post is brought to you by the developer of BitBudget. BitBudget is an automated budgeting app for Android and iOS which syncs with your bank account and helps you avoid overspending. If you’d like to quit living paycheck-to-paycheck and get a better handle on your finances, download it today! https://bitbudget.io
This post is sort of just a bookmark for myself, as I know I will undoubtedly need to reference the React-Native/Redux boilerplate for years to come. However, maybe someone else out there on the internet will find this helpful as well! TLDR: Aligator.io has the best quickstart tutorial with all of the boilerplate code that you need to get up and running with Redux in a React-Native project.
Now for some more opinion and a quick rant: All of the boilerplate code that is necessary to get up and running with Redux is its biggest drawback. Personally, I hate boilerplate code. Maybe that’s because I’m a pretty messy and disorganized person, but I can’t stand having to write and learn tons and tons of boilerplate code just to get started with something. Take the Django web framework for instance. The first Python web-dev project I ever undertook I initially turned to Django after coming from a PHP background. But after 4 pages of “Getting Started” material I still had not gotten to “hello, world.” So I ended up ditching Django in favor of the much simpler Flask web framework, and haven’t looked back since.
With Redux I find myself in a similar predicament. I need some sort of state management for my React projects as the built in system just isn’t cutting it anymore, but is Redux really the best option? A much simpler solution is Unstated. So if you’ve made it this far in my post and are having similar feelings, I suggest checking out Unstated.
The only problem with Unstated is that employers are probably using Redux (or possibly MobX-State-Tree). So you kind of have to learn it, just because that’s what everyone seems to be using. In essence, I don’t think Redux is so bad. Actions, reducers, and a store. Pretty straight forward right? It sounds simple, but in practice it’s probably the most painful part of programming in React.