Become proficient with React Hooks
State Management with React Hooks
In the React world, after learning React, the advice has always been to learn Redux. Now I'd argue this becomes only true if you deal with large size applications that have complex state management scenarios. With React itself, you can implement powerful state management yourself with State, Reducer, and Context Hooks. I strongly believe this will become common sense for React applications. Follow the tutorial to learn more about all three Hooks while building one predictable and maintainable React application yourself.
What should I use: useState or useReducer?
With all the new built-in Hooks released for React, it's not easy to tell when to use which Hook. Both useState and useReducer hooks are used for state management. Only time will tell which one to use for different state management scenarios, but I have come up with a great comparison that should guide you when to use useState or useReducer for your React application. Afterwards, you should be well aware of when to transition from a useState hook to a useReducer hook.
Reducers in React without Redux?
Reducers are a concept mainly known for Redux. Now you can use them in React with the new useReducer Hook. If you haven't learned about Redux yet, this concept may be new to you. That's why I wrote about Reducers in JavaScript and the new Reducer Hook for React in detail. After reading both tutorials, you should be set up for Reducers in React without any Redux.
React Hooks change how we will write React applications in the future. All my tutorials are designed to give you a great experience to learn about them. If you don't have enough yet, check out how to implement the popular game called Snake with React Hooks or how to interact with the local storage with React Hooks to synchronize your state with the browser.
That’s it from my side. I hope all the content is interesting to you. See you again with a lot more React and JavaScript next time! Best, Robin
PS.: As always, I am super happy about your nice reviews on Amazon. If you have read one of my books and it had an impact on you, it would mean the world to me if you head over and leave your feedback there.
Book Recommendation
The last book I read was Company of One. It aligned with my values, because even though I started being self-employed two years ago, I never really wanted to grow a large company myself. Staying small as a company, being just one or a few persons, allows me to have focused work time and happy leisure time with family and friends.