Hi, my name is Chris and I'm a Senior Frontend Engineer in New York City, and I hope this video helps you understand:
What is the useFetch custom React Hook?
What is a custom hook?
What is a Reducer pattern and how does it relate to State Machines?
How can I write React with TypeScript?
How can I create a NextJS Project?
I mostly use TypeScript, NextJS and React in my day-to-day work so the examples shown in this video will reflect these technologies.
I hope you enjoy, and please share with a friend!
Comments and suggestions are appreciated.
00:00 Intro
00:31 What does useFetch do?
00:59 React Project Overview
01:42 NextJS + TypeScript Project Setup
04:15 Creating display React Component
11:38 Setting up the useFetch hook
13:08 Creating a Reducer
21:20 Writing the useFetch Hook
35:09 Integrate useFetch hook in Component
40:12 Improvements and Caching
44:05 Outro
RESOURCES:
Matt Pocock on Return Types:
[ • Should you use return types? ]( • Should you use return types? )
Code example from useHooks site with optional Cancel mid-call feature:
[usehooks-ts.com/react-hook/use-fetch](usehooks-ts.com/react-hook/use-fetch)
Shoutout to some friends in helping craft the code example for this video:
@JongsunSuh
@PushToProdOnFridays
@DanielNaganoGerace
コメント