All React-hooks posts

  • Typing React Context In TypeScript

    Typing React Context In TypeScript

    Updated on · 5 min read

    In this article, we'll see how to type React context in TypeScript. We explore the process of creating a theme context supporting dark and light themes, addressing type-related challenges along the way.


  • TypeScript: Typing React useRef Hook

    TypeScript: Typing React useRef Hook

    Updated on · 5 min read

    Discover how to effectively type the useRef hook in TypeScript for React applications that require imperative DOM manipulation. Learn best practices, common pitfalls, and practical examples, such as controlling the focus state of an input element.


Back to all posts