
Testing React-Query with Jest and React-testing-library
Introduction In this article we will cover the basic usage of testing useQuery hook from tanstack/react-query library, along with how to test it using jest and react-testing-library….

Highcharts How To Change Series Color with examples
To change the color of a series in Highcharts, there are a set of options we are going to discover in this article. Option 1: Using the…

A quick introduction to Javascript shadow DOM
Introduction JavaScript Shadow DOM is a powerful tool for creating isolated and reusable components in web development. It allows developers to create custom elements with their own…

Mock useSearchParams react testing library
To mock the useSearchParams hook from react-router-dom, you can use Jest’s mock function to provide a mocked implementation for the hook. For example: Consider we’ve a URL…

How to format relative times in Javascript
Introduction Formatting relative times in JavaScript can be a useful way to present information to the user in a human-readable format. A relative time is a time…

Looping through Javascript Set object in React
In React, you can loop over a JavaScript Set using the Array.from() method to convert the Set object to an array. You can then use the map()…

Looping through Javascript Map object in React
In ReactJS, you can loop over a map using Object.entries() method to convert the Map object into an array of key-value pairs, and then use the map()…

The basic guide for React Query useMutation hook
React Query is a popular library for fetching, caching, and updating asynchronous data in React applications. It provides a number of hooks, including useMutation that allows you…

How to measure the performance of javascript function
Introduction There are several ways to measure the performance of a JavaScript function. One way is to use the performance.now() method, which is part of the Performance…