Prevent Unnecessary Re-Renders of Components When Using useContext with ReactWhen managing global state in React applications, useContext is a powerful and convenient tool. However, it comes with a common pitfall: unnecessary re-renders of components subscribing to the context. In this article,I'll explore why this happens, e...Jan 12, 2025 · 6 min readblog.allaroundjavascript.com
Battle of the Architectures: Dynamic UI with RTK Query vs. Next.js Simplicity1. Introduction When building a modern web application, developers are spoiled for choice with tools and frameworks. On one side, we have RTK Query and React Router, providing flexibility and control over data fetching and routing. On the other, Next...Jan 11, 2025 · 7 min readblog.allaroundjavascript.com
Difference between extending and intersecting interfaces in TypeScript?Have you ever found yourself thinking in a complex project asking this question, then in this article I will try to answer with examples Let's say the following type is defined: interface Shape { color: string; } Now, maybe we need a way to abstra...Aug 25, 2024 · 3 min readblog.allaroundjavascript.com
What is Typescript 's exclamation(!) mark operator, or bag and how does it work?TL;DR The bang operator tells the compiler to temporarily relax the "not null" constraint that it might otherwise demand. It says to the compiler: "As the developer, I know better than you that this variable cannot be null right now". I think this qu...Aug 23, 2024 · 3 min readblog.allaroundjavascript.com
Typescript generic : T vs T extends {} Difference and ExamplesTLDR: "T extend {}" allow you your function or class' method to accept pretty much anything except null and undefined. T can be a primitive though. On the other hand, only T, allow accepting also those value, null and undefined I do work with Typescr...Apr 17, 2023 · 3 min readblog.allaroundjavascript.com