Udemy
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
React Hooks and Context (with React-Redux migration guide)
Rating: 4.0 out of 5(441 ratings)
14,676 students

React Hooks and Context (with React-Redux migration guide)

Learn the future of React and how to migrate your existing Redux code
Created byMohammad Iqbal
Last updated 6/2019
English
English [Auto],

What you'll learn

  • React Hooks at a Deep Level
  • Use React hooks with existing Redux code
  • useState, useEffect, useReducer, useContext
  • Global state with Context api
  • Mimic Redux functionality with just Hooks
  • Redux migration guide to React Hooks
  • working with forms and React hooks

Course content

2 sections23 lectures50m total length
  • React Hooks Intro0:34

    Discover React hooks that let functional components read and update state by hooking class functionality. Learn how hooks simplify development, boost performance, and guide migration toward hooks alongside Redux.

  • 2 rules off using hooks0:31

    Identify the two rules of using hooks: keep hooks at the top level to avoid nesting, and never call hooks outside of a function, including the use effect hook.

  • 4 Hooks Overview1:24

    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.

  • useState() overview2:58

    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.

  • useEffect() overview1:07

    Explore the useEffect hook and its three usage patterns: no second argument, empty array (mount, like componentDidMount), and value array (trigger on change).

  • useReducer() overview1:16

    Discover how the useReducer hook uses a first argument as the state value and a second argument as a function that changes the state, dispatch actions, and mirror redux patterns.

  • Context overview1:53

    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.

  • useContext() overview2:33

    Create a context with React.createContext, wrap the app in a provider with a value prop, then use useContext to read and update the global state.

  • Migration Guide from Redux to React hooks0:45

    Explore a Redux to React hooks migration with minimal changes: keep actions and reducers intact, export both initial state and reducer, pass them to useReducer, and follow a code example.

  • 6 ways to update state reference0:09

    Explore a table that compares six ways to read an update state in React, helping you quickly resolve confusion and refer back to this table.

  • For more free courses in the future follow me on twitter0:02

Requirements

  • Javascript and basic React

Description

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.


Who this course is for:

  • Beginner React students