🤞 Promises

And SEO for developers

Hey guys!

In today’s edition, I share a really useful blog post for junior React developers on understanding Promises at a deep level, plus a great presentation on why to use Redux in 2024, and a really good post on understanding the value of canonical tags for SEO.

Let's do this! 🤙

Before we get into today’s edition, I’d love to learn a little more about you so that I can ensure my content is providing value.

What is your experience with React?

Login or Subscribe to participate in polls.

⚡️ The Latest In React

💻️ React Owner Components
In React, "owner" refers to a component in the hierarchy, akin to a "parent". This term, once common in early React development, is now rarely used by newer developers. However, it's still relevant, particularly for distinguishing between client components and server components (RSC).

🤞 Promises From The Ground Up
Understanding Promises requires a fairly deep knowledge of JavaScript's workings and limitations. Without this context, Promises can be confusing. Despite this challenge, mastering Promises is essential as they are the standard for handling asynchronous code. Modern web APIs heavily rely on Promises. This blog is a really good guide to learning promises, all the way down to the fundamentals.

🧐 SEO for Devs
After investing hours or days planning, outlining, and writing an article, or building a project, it's crucial to understand the canonical tag's value for SEO. Once you publish your work, the canonical tag helps prevent duplicate content issues and consolidates link equity. This is vital for building a personal or product brand, ensuring search engines recognize the original source of your content.

❓️Why Use Redux Today?
Mark Erikson recently presented on the relevance of Redux today. He noted that the Redux team hasn't focused on marketing or promoting Redux but instead emphasized when not to use it. Redux is often overused or misused. The maintainers aim to make Redux the best it can be, ensuring it works well if chosen. His slideshow recaps why Redux was created, examines the evolving ecosystem, and discusses the trade-offs of using Redux.

✏️ How to use React Context effectively
Mark Erikson recently presented on the relevance of Redux today. He acknowledges that the Redux team hasn't focused on marketing or promoting Redux but instead has emphasized when not to use it. Redux is often overused or misused. The maintainers aim to make Redux the best it can be, ensuring it works well if chosen. His slideshow recaps why Redux was created, examines the evolving ecosystem, and discusses the trade-offs of using Redux.

Common React Mistakes

Free Code Camp recently posted a good article on common React mistakes, I’ll share the basic premise below, but if you want to see the full list and best practices to avoid these issues. Check out the full article.

  1. Mistakes in Key Props Usage One frequent error in React is the misuse of the key prop, particularly in lists. The key prop helps React track item changes, additions, or removals. Incorrect key usage can hinder React's diffing algorithm, causing performance issues and bugs.

  2. Ignoring the Virtual DOM Some developers mistakenly believe they need to update the DOM themselves, misunderstanding the Virtual DOM's role. This can lead to unpredictability and bugs.

  3. Overusing State While state management is crucial in React, excessive state usage can complicate components and make them hard to maintain. Each state change triggers a re-render, which can be costly if not managed properly. Best Practice: Minimize state use and lift state only when necessary. For global state, use contexts or state management libraries like Redux.

  4. Forgetting to Clean Up Effects The useEffect hook requires cleanup to prevent memory leaks and unintended behaviors. This includes clearing subscriptions, timers, or event listeners when the component unmounts or dependencies change.

  5. Ignoring Performance React applications can suffer from performance issues due to excessive re-renders and heavy calculations during render. Best Practice: Use React.memo, useMemo, and useCallback to memoize components and values, enhancing performance.

  6. Overusing the Context API While the Context API is useful for passing data through the component tree without prop drilling, it can be overused, leading to performance problems. Best Practice: Avoid using context for frequently changing values, and use it mainly for static values or rare updates.

You can find the full article here!

Refactoring a React Component (Design Patterns)

In this video, I take a complex, messy component and refactor it using design patterns.

If you want to be an efficient senior-level React developer, you should be able to refactor working coding using design patterns.

The video is already live. Go check it out!

Thanks for reading!

Darius