October 2023
Intermediate to advanced
80 pages
1h 7m
English
Using TypeScript in any large React application provides a level of safety that’s worth the additional effort over using JavaScript. TypeScript is able to comb through all of our components and confirm that we’re passing in all the props each component requires, and it makes sure sure they’re actually the types we assume they are and not something nefarious like undefined. But there are some cases where even that trade-off is thrown into question—particularly when it comes to using the Context API. Let’s look at how to navigate some of the challenges of using createContext and useContext with TypeScript.
I’m going to assume you’re familiar with the Context ...
Read now
Unlock full access