filmov
tv
useReducer is BETTER than useState | React Hook useReducer Tutorial
Показать описание
If you are building React apps with multiple state values to keep track of, your React apps need the useReducer hook! In this useReducer React Hook tutorial, you will learn how to apply useReducer to manage the state of your apps.
useReducer is BETTER than useState | React Hook useReducer Tutorial
(00:00) Intro
(00:12) Welcome and Overview
(01:05) useReducer vs useState
(01:53) Initializing useReducer
(03:33) Creating the reducer function
(05:42) Using dispatch and updating JSX
(07:12) Moving all state and handling an action payload
(08:25) An easy mistake to make
(10:01) Displaying state values in JSX
(12:44) Recommended: Action object lookup and dot notation
🔗 ES7 React JS Snippets Extension for VS Code:
🔗 React Dev Tools Extension for Chrome:
📚 References:
✅ Follow Me:
Was this tutorial about the React hook useReducer helpful? If so, please share. Let me know your thoughts in the comments.
#usereducer #react #hooks
Комментарии