Copy
Stay up to date with the latest news on React.
View this email in your browser

The React Newsletter

Hi <<First Name>>,
 
Compound Components In React
A compound component is one of the advanced patterns of React which makes use of an interesting way to communicate the relationship between UI components and share implicit state by leveraging an explicit parent-child relationship.

Read more
 
Catching Errors in React with Error Boundaries

Even the most flawless applications have runtime errors from time to time. The network might time out, some backend service might go down, or your users might provide you with some input that just doesn’t compute. Or – you know – bugs. But what’s the best way to handle errors to ensure your app is resilient, continues to be responsive and provide the best possible user experience?

This article is going to introduce you to the concept of error boundaries in React. We’ll look at what challenges they try to solve, what shortcomings they have, and how to implement them. Lastly, we’ll look at a small abstraction layer that makes error boundaries even better!


Read more
 
A Beginner's Guide to GraphQL | Build an API using AWS Amplify and AppSync
What is GraphQL? Why would you use it? Why wouldn't you use it? How do you create an API and query with it in GraphQL? Learn all that and much more in this tutorial.

Watch video
 
What Are Proper Use Cases For Snapshot Testing React Components?

One of the most common ways to write test tests in React is through snapshot tests. They are very convenient, easy to use, and require little to no testing effort. But over the past years, they have fallen out of favour more and more in the field of React. Most of the people in the community have concluded that snapshot tests barely hold any meaningful value. Whereas behaviour tests that are reflective of how users interact with your application are more reliable, realistic, and useful.

Due to this, most React developers have gotten rid of snapshot tests entirely and migrated their testing codebase towards behaviour tests focused style. Nowadays, snapshot testing is often viewed as a fake form of testing, only providing a false sense of security. You’ll often hear that unless you have specific reasons to perform snapshot testing, it’s recommended to stay away from them.

After hearing that piece of advice over and over again, I knew that I shouldn’t use snapshot testing as a default and that it only really had specific use cases. But I didn’t understand when I should use it. What are use cases for snapshot testing? When do they make sense? What are they actually useful for?

Over the past months, I’ve looked out for these use cases while developing React components. I wanted to see in which scenarios snapshot tests would make more sense than standard unit or behaviour tests. After spending quite some time on it, I finally understood the underlying issue with snapshot tests. With this, I realised why snapshot tests were abandoned and what makes them so meaningless, but also in which use cases they are most relevant. This article will that knowledge with you.


Read more
 
Announcing TypeScript 4.4

Today we’re excited to announce the availability of TypeScript 4.4!

If you haven’t heard of TypeScript yet, it’s a language that builds on JavaScript by adding syntax for static types. Tools like the TypeScript compiler just erase those types, leaving you with clean readable JavaScript that you can run anywhere; but those types are there to be type-checked! Types make your intentions explicit, and tools can read and understand them to catch errors before you even run your code. By checking your types, TypeScript can catch errors like typos, logic errors, and more! Beyond catching errors, TypeScript also uses types to power editor tooling like accurate code-completion, go-to-definition, and renaming. You can learn more on the TypeScript website.


Read more
 
Not All Components Are Created Equal
We used to argue about dividing our components into categories, until we renounced this pattern as a community. But what if we missed out on valuable lessons about what makes our components more comprehensible?

Read more
 
React video courses
Because I need to pay my bills 😉
 
Copyright © 2021 ABL - The Problem Solver, All rights reserved.


unsubscribe from this list    update subscription preferences 

Email Marketing Powered by Mailchimp