State management with #react Context, #typescript, and #graphql
▻https://hackernoon.com/state-management-with-react-context-typescript-and-graphql-fb6264314a15?
Tired of debugging type errors in your state? Want up-to-date documentation for your React apps? Read on!Side effects of type errors: Lost dev time and increased irritabilityWhen I first encountered TypeScript, I felt a decent amount of despair: Why did I have to write what felt like more boilerplate code? When using it with React, why did I have to determine the type of every single React prop, and the request and response objects for async calls? And what the hell were intersection and union types?After spending time working with TypeScript, however, I quickly fell in love with it. It saves me from wasting time on dumb type errors, provides dynamic self-documentation, and makes it far easier for my colleagues to understand the expectations set for the code at first glance.My interest (...)