And stop entire fetch work in "Loading.." like this screenshot.
==================================================================
==================================================================
RTK-Query setup is here.
import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query/react'
import type { DocsList } from './types'
// Define a service using a base URL and expected endpoints
export const docsApi = createApi({
baseQuery: fetchBaseQuery({ baseUrl: '' }),
endpoints: (builder) => ({
getDocsList: builder.query<DocsList, void>({
query: () => `/docs_list`,
}),
}),
reducerPath: 'docsApi',
})
// Export hooks for usage in functional components, which are
// auto-generated based on the defined endpoints
export const { useGetDocsListQuery } = docsApi
And this is whole codebase: https://github.com/laststance/vite-rtk-query
To reproduce, follow Install guide and you'll see the bug in a minute.