SERIES: React Native (Step by Step) — React Redux + Toolkit with Typescript

Redux — WHY?

To get started, I’m assuming that you have basic knowledge of React Native and Redux. If you need a small refresher on Redux, I’ve got just the article for you! As we continue with the setup from our last session, we are still working with Expo to manage our React Native Build and bundling.

Redux Toolkit — WHY?

In the past, I had decided to not work with Redux Toolkit. I used to prefer the hands-on way to do it as Redux is not scary and definitely not complicated, once you understood the basic priciples. I couldn’t argue against the boilerplate argument there but then again it’s not that bad and you do not spend THAT much time writing redux code in my experience.

Redux — HOW?

We need to install the packages for redux, react-redux and the toolkig in your production dependencies and additionally the react-redux types (which are missing from the react-redux package) for development.

# prod packages
npm install redux react-redux @reduxjs/toolkit
# dev package
npm install -D @types/react-redux

Conclusion

We’ve continued with our React Native Typescript project from last time and added a fully functioning and fully typed Redux Store in about 30 lines of redux code (imports excluded) and a few lines of tsx. That said, I should maybe rewrite my original redux article and the updated version will be a lot shorter…

Some words about me:

If you want to see more of my work and progress, feel free to follow me and check out my other articles. If you clap feverishly for the articles you like most, it will be easier for me to decide which directions to pursue in following articles so use your ability to cast a vote for future content.

--

--

I’m a Web / App Developer & father 👨‍👩‍👧 doing freelance and part-time agency work since 2003, 💻 building stuff on the side 🕹 and attending conferences 🎟

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Konrad Abe

Konrad Abe

I’m a Web / App Developer & father 👨‍👩‍👧 doing freelance and part-time agency work since 2003, 💻 building stuff on the side 🕹 and attending conferences 🎟