custom hooks

A collection of 1 post

Typing React Context to avoid an undefined default value

React Context API is really useful when it comes to sharing data between disconnected components without prop drilling, here is a way of correctly type the Context API to avoid a default value or a non-null TypeScript assertion.

Get The Best Of All Hands Delivered To Your Inbox

Subscribe to our newsletter and stay updated.