Tutorialspoint
Subscription Includes
$ 130   8.77

Learn the React hooks by example

Created by Sandra L, Last Updated 17-Nov-2020, Language:English

Learn the React hooks by example

A complete overview of the hooks with useState, useEffect, useCallback, useMemo, useRef, useReducer and useContexte

Created by Sandra L, Last Updated 17-Nov-2020, Language:English

What Will I Get ?

  • How to use React hooks
  • Learn useState, to add and update local state inside a function component
  • Learn useEffect, to apply side effects whenever the state changes
  • A complete guide to additional hooks like useMemo, useCallback, useRef, useReducer and useContext
  • Learn to build your own hook to encapsulate and reuse stateful logic
  • Learn by examples with a practical project : data fetching with function components only

Requirements

  • Be familiar with React and have solid JavaScript knowledge
  • Understand some fundamental React concepts such as JSX, props, event delegation, composition and the react CLI
  • Understand the basics of the state management with Redux with actions, dispatch and reducers

Description

The hooks, are a new addition to the React library since version 16.8, that let you write stateful component without the need to write a class,

The course is fast-paced with practical example and project to get you up to speed fast with using hooks, from basic to advanced.

1) We begin with an overview of the basic hooks, with :

  • useState : to add and update local state inside a function component

  • useEffect: serving the same purpose as componentDidMount and componentDidUpdate, the effect hook to apply side effects in your function component when the local state updates

2) Then, we dive into the additional hooks, with :

  • useContext

  • useCallback and useMemo

  • useReducer

  • useRef

3) Finally, we learn to build custom hooks to isolate and reuse stateful logic between multiple function components :

  • to make network call to APIs

  • to validate forms

  • and,  to add theme configuration to your project with the option to toggle dark and light theme

Course Content