Found multiple elements error in React Testing Library

Found multiple elements error in React Testing Library

Introduction While working with React-Testing-Library to test UI components, you might encounter an error like the following: HTML Structure: Here’s an example of the HTML structure that…

How to invalidate query after mutations in React-Query

How to invalidate query after mutations in React-Query

Introduction Query invalidation is an essential part while working with React-Query. Usually, when there is a mutation in the app, there are queries related, and when a…

Find last index of element inside array by certain condition

Find last index of element inside array by certain condition

In Javascript, the following snippet of code pass over an array of objects and does filter the array based on certain conditions, the output of this process…

Detect If Browser Tab Has Focus

Detect If Browser Tab Has Focus In Javascript

There are a few options we can use in order to Detect If Browser Tab Has Focus In Javascript. Some of those options are: 1- Detect using…

How to handle multiple queries with React-Query

How to handle multiple queries with React-Query

A super cool feature of React Query is that we can execute multiple queries in the same component, whether these queries are dependent or independent of each…

Intercepting Responses in Node.js with Puppeteer

How to wait for N seconds in Puppeteer

Puppeteer is a Node library that provides a high-level API to control Chrome or Chromium over the DevTools Protocol. Puppeteer runs headless by default, but can be configured to run…

No QueryClient set, use QueryClientProvider to set one

No QueryClient set, use QueryClientProvider to set one

When working with React-Query you might encounter the following error: No QueryClient set, use QueryClientProvider to set one, this source of this error might be one of…

how-to-get-days-in-a-month-using-javascript

Get the number of days in a month using JavaScript

Introduction There are a few options we can use to get the number of days in a month using JavaScript, let’s check the following examples to see…

react-heatmap-js-how-to

Implement Heatmaps using HighCharts in React

Introduction HightCharts is a powerful library for creating data visualizations, It comes with many tools that allow to creation of a reliable and secure chart. This article…