Skip to content
Advertisement

axios error react interceptors request is not a function

i have a configuration with axios i am testing a feature to receive a list of students from an api, the problem is that it sends me an error:

TypeError: constants_api_constants__WEBPACK_IMPORTED_MODULE_1_.default.interceptors.request is not a function

For my axios configuration I use:

JavaScript

How I resolve my promise, (without interceptor this work fine):

JavaScript

Advertisement

Answer

Interceptors are used to intercept any request/response before it goes to try/catch.

JavaScript

Interceptor

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement