Use TypeScript with React Context API

preview_player
Показать описание
Hi, I'm Wesley. I'm a brand ambassador for Kinde (paid sponsorship).

👉 Discord: all my courses have a private Discord where I actively participate

⏱️ Timestamps:
0:00 Explanation

#webdevelopment #coding #programming
Рекомендации по теме
Комментарии
Автор

You are an actual gold mine of knowledge, thanks for your hard work!

ThreiasFB
Автор

This is very helpful for react context and type script, the best video

irinaa
Автор

I was actually looking for typescript useReducer.
Usually attached to context in React...

Thanks anyway

wishmeheaven
Автор

Wouldn't it be easier to infer the types from a custom hook with ReturnType:

const useMainState = () => {
const [activeSection, setActiveSection] = useState<SectionName>('Home')
return { activeSection, setActiveSection}
}

type ActiveSectionProps = ReturnType<typeof useMainState> | null
const ActiveSectionContext =

alvaro-escalante-naves
Автор

Next time start a video with 1 billion lines of code

cao_dzecbi