Hope your all are doing fine.
Im using Typescript with RTK mutation everything is working good but if i send any error from backend in specific json format like
{
status: "Error",
message "Something went wrong"
}
when i check on my browser network tab its showing me the correct error response like:
{
data: {
status: "Error",
message "Something went wrong"
}
}
Im getting error in the mutation hook:
const [createCategory, {isLoading, error }] = useCreateCategoryMutation();
but I can't access error.data.message in my react it is giving me types error like:
Property 'data' does not exist on type 'FetchBaseQueryError | SerializedError'.
