
This lecture offers a basic overview of four main hooks—useState, useEffect, useContext, and useReducer—and their roles in local versus global state via context.
Discover how useState initializes local state in functional components, returning [state, setState], with separate setters for each property, avoiding this and props, and optional additional state via another useState call.
Explore the useEffect hook and its three usage patterns: no second argument, empty array (mount, like componentDidMount), and value array (trigger on change).
Explain context as a means to pass a value from a parent to deeply nested components, enabling a global state, read and update via the provider.
Demonstrate building a basic app by wiring a React hook alongside existing Redux code. Compare React hooks and Redux side by side while integrating them into the project.
Learn to implement the useEffect hook in a React app by importing useEffect, wiring it to state with useState, and using a 3000 ms timeout to update and render values.
Learn to implement the use reducer hook by importing a reducer, initializing state, and dispatching actions via action creators to drive user interface updates.
Set up global state with context using the useReducer hook, mirroring redux with success and failure actions; expose state and dispatch, and toggle Prop 2 via two buttons.
Explore implementing form state with useReducer, creating action types and action creators for input change and submit, and wiring a reducer and dispatch to manage user text in the form.
React Hooks?
React Hooks are the biggest fundamental change to React since React Fiber in Late 2017.
Previous tutorials with Redux and older patterns are becoming obsolete. Stay competitive and learn the current and future version of React.
I will show you how to migrate from React-Redux to React hooks without changing any of your Redux Code
What this course will cover?
We will begin with a detailed explanation about each of the major hooks. Then once we understand the hooks at a deep level we will begin coding.
I will give a detailed explanation of React hooks then we will go over how to integrate React Hooks into existing React - Redux projects. We will build these hooks from scratch so you will get the best of both worlds.
We will cover all the major hooks and I will show you how to write them in code.
By the end of the tutorial you will have the building blocks necessary to build complex apps.