I Stopped Using useQuery for useRequest — Here’s Why

January 11, 2026 09:55

Over the past year, I’ve slowly moved most of my React data-fetching logic from useQuery in TanStack Query to useRequest from ahooks. For a long time, ...

React State Co-Location

January 9, 2026 09:44

We all know that React has re-rendering performance challenges. This is also inherent in how React works: when a component’s state or props change, a re-render occurs. However, ...

jest.clearAllMocks vs jest.resetAllMocks vs jest.restoreAllMocks explained

August 31, 2022 16:08

I know is been hard to remember and confuse about what these clearAllMocks, resetAllMocks and restoreAllMocks actually does and why we need that? ...

Array print()

August 6, 2022 16:03

How troublesome every time console.log to each array chain method result for debugging? Let's see following code...

How to mock function that called inside module

June 10, 2022 07:58

Problem Iets say you have the file // file.js export function b() { return...

How test script help you write a safety code?

July 29, 2020 17:33

Code without test script is like writing an essay without proofreading. End up, full of grammar mista...

Tips to create a constants file in Javascript

March 7, 2020 16:06

It shouldn't be difficult to just create a constants file and keep all your value in one place, so th...