You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The inferred type of 'useLatestProductsQuery' cannot be named without a reference to '../../../node_modules/@reduxjs/toolkit/dist/query/react/buildHooks'. This is likely not portable. A type annotation is necessary. How to resolve this error?
#4498
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
The text was updated successfully, but these errors were encountered:
Abhishekiitb25
changed the title
The inferred type of 'useLatestProductsQuery' cannot be named without a reference to '../../../node_modules/@reduxjs/toolkit/dist/query/react/buildHooks'. This is likely not portable. A type annotation is necessary
The inferred type of 'useLatestProductsQuery' cannot be named without a reference to '../../../node_modules/@reduxjs/toolkit/dist/query/react/buildHooks'. This is likely not portable. A type annotation is necessary. How to resolve this error?
Jul 7, 2024
import { createApi, fetchBaseQuery } from "@reduxjs/toolkit/query/react";
import { AllProductsResponse, CategoriesResponse } from "../../types/api-types";
export const productAPI = createApi({
reducerPath: "productApi",
baseQuery: fetchBaseQuery({
baseUrl:
${import.meta.env.VITE_SERVER}/api/v1/product/
,}),
endpoints: (builder) => ({
latestProducts: builder.query<AllProductsResponse, string>({
query: () => "latest",
}),
allProducts: builder.query<AllProductsResponse, string>({
query: (id) =>
admin-produc?id=${id}
,}),
categories: builder.query<CategoriesResponse, string>({
query: () =>
categories
,}),
}),
});
export const {
useLatestProductsQuery,
useAllProductsQuery,
useCategoriesQuery,
} = productAPI;
The text was updated successfully, but these errors were encountered: