Always Use a Custom Hook for Context API, Not useContext (React Context API, TypeScript)
https://youtu.be/I7dwJxGuGYQ
Step 1: Create the Theme Context
First, we need to create the context for our theme.
import React, { createContext, useState } from 'react';
type Theme = 'dark' | 'light';
type ThemeContextProps = {
theme: Theme;
s...
jason60810.hashnode.dev2 min read