The coding articles collection contains curated stories, tips, questions and answers on a wide variety of topics. The main focus of these articles revolves around the languages and technologies presented in snippets, as well as career advice and lessons.
Avoid unnecessary re-runs by using primitive dependencies in your React effect.
Testing React components that use portals can be difficult until you understand what you really need to be testing.
When working with multiple
useState hooks in React, things can get a bit complicated while debugging. Luckily, there's an easy way to label these values.
Wrapping your mind around React hooks and how they interact with
setInterval() can be difficult. Here's a guide to get you started.
When working with state in your code, you often run into issues with maintaining complexity and readability. Oftentimes, these issues are easily fixable.
Learn the differences between
PropTypes.shape() and where to use each one with this quick guide.
When developing React components, you might often need to conditionally apply a className. Learn how to handle empty classNames correctly using this handy tip.
Learn of all the different ways to set the value of a selected input in React with this quick guide.
Testing React components that update asynchronously with React Testing Library is a common scenario. Learn how to deal with common issues and speed up your testing.
Testing Redux-connected components with React Testing Library is a very common scenario. Learn how to use this simple utility function to speed up your testing.
Take a deeper dive into React's rendering process and understand how to make small yet powerful tweaks to optimize performance.
Take a deeper dive into React's rendering process and understand the role of the Context API and Redux in it.
As powerful as React is, it is also quite fragile at places. Did you know that just a few lines are more than enough to break your entire React application?
Testing stateful React components is by no means a difficult task, but did you know there is an elegant solution that doesn't involve testing state directly?