State Management in React With Redux Tutorial

With Hooks, Async Functions and best practices

Ignacio Nicolas Aguirre
Jan 21 · 7 min read
Image for post
Image for post

Pre-requisites:

Redux takes care of all this.

Redux

Adding Store

Code screenshot
Code screenshot
App.js

Reducers

Code screenshot
Code screenshot
App.js

Adding Redux to React

Code
Code
Image for post
Image for post
App.js
Image for post
Image for post
Header.js

Hooking into Redux

Image for post
Image for post
Header.js

Updating State with Actions

Code screenshot
Code screenshot
App.js
Image for post
Image for post

Final Step: Taking Action to Change State

Image for post
Image for post
Header.js

Updating State with custom data

Image for post
Image for post
App.js
Image for post
Image for post
Header.js

Async functions in Redux

Image for post
Image for post
App.js
Image for post
Image for post
Code screenshot
Code screenshot
Header.js

Folder Structure and Best Practices

My way

App folder structure
App folder structure
Folder Stucture
Image for post
Image for post
App.js
Image for post
Image for post
store/index.js combining reducers
Image for post
Image for post
Image for post
Image for post
Header.js

Extra Resources to Learn folder structure

Final Thoughts

Happy coding!

The Startup

Medium's largest active publication, followed by +771K people. Follow to join our community.

Thanks to Anupam Chugh

Ignacio Nicolas Aguirre

Written by

Founder @ Snowball Financial Education www.snowballfinances.com | Javascript Developer

The Startup

Medium's largest active publication, followed by +771K people. Follow to join our community.

Ignacio Nicolas Aguirre

Written by

Founder @ Snowball Financial Education www.snowballfinances.com | Javascript Developer

The Startup

Medium's largest active publication, followed by +771K people. Follow to join our community.

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app