Build a Simple Application Sidebar: Easy useContext React Hooks Tutorial

Опубликовано: 14 Октябрь 2024
на канале: Web Dev Fuel
1,388
30

In this video you'll learn how to create a sidebar inside a React application that toggles with the help of the useContext uook.

This will help you understand how to use the useContext from the React Hooks to manage and access global state inside your React applications.

Learn how to build full-stack web applications with JavaScript and React:    • Build Your Own PERN Stack Todo List A...  

---

useContext React Hooks - Simple Form Refactoring Tutorial:    • Simplify Your React Forms with useRed...  

00:00 Introduction
02:18 How does it compare to Redux?
04:01 Create Sidebar context with createContext
05:20 Add Context Provider to app parent component
06:16 Add sidebar state with toggle function
07:37 Add values to Context Provider
08:14 Access values with createContext on Sidebar Component
10:04 Access values with createContext on Toggle Component
11:32 Test sidebar toggle functionality
12:45 Conclusion