Testing React portals
Testing React components that use portals can be difficult until you understand what you really need to be testing.
30 seconds of code contains a curated collection of code articles covering a wide range of development needs. The collection spans many topics, ranging from simple coding problems to theoretical concepts and development techniques.
Testing React components that use portals can be difficult until you understand what you really need to be testing.
You can use a CSS pseudo-class selector to style all links in a page, without worrying if they have been visited or not.
Maps and objects are very similar, but they have some differences that can help you decide which one better fits your use-case.
Static and instance methods are pretty easy to distinguish and serve different purposes. Learn all about them in this article.
Recursion is a very important programming concept all developers should be familiar with.
DNS records may not be something you work with frequently, but having a basic understanding can be highly beneficial.
Pure functions are a very important concept to know, especially if you're interested in functional programming.
Did you know there's a JavaScript value that's not equal to itself?
How JavaScript handles passing data is a source of confusion and bugs for many developers, especially when it comes to object types.
JavaScript's strict mode can make your code faster, cleaner and more secure.
Understanding the difference between these two object-oriented programming paradigms is key to taking your skills to the next level.
Understanding the differences between synchronous and asynchronous code is a crucial piece of knowledge for every web developer.
Testing React components that update asynchronously is pretty common. Learn how to deal with common issues and speed up your testing.
Learn everything you need to know about higher-order functions with this short guide and level up your programming skills.
Learn how to use CSS pseudo-classes to style an element based on changes to its state.
Testing Redux-connected components is pretty common. Learn how to use this simple utility function to speed up your testing.
In React components, you might need to conditionally apply a className. Learn how to handle empty values correctly using this handy tip.
JavaScript's switch statement often feels hard to remember and a little bit out of place. Maybe it's time to use object literals, instead.
Typography might seem intimidating, but you can quickly and easily create a simple typographic scale with this basic technique.
Multiple useState hooks in React can complicate things while debugging. Luckily, there's an easy way to label these values.
JavaScript distinguishes expressions and statements. Learn their differences in this short article.
As powerful as React is, it is also quite fragile at places. Did you know that a few lines can easily break your entire React application?
While both the prefix and postfix operators increment a value, the resulting value of the expression is very different.
JavaScript's promises represent the eventual completion (or failure) of asynchronous operations and their resulting value.