All Questions
787
questions
0
votes
0
answers
34
views
Encounter CORS issues with CRUD features when deploy to Render & Netlify
Currently, I'm trying to achieve the following features on my personal project
Feature #1: Displaying detailed information for each Pokemon on a new page
Feature #2: Updating the Pokemon on that page
...
2
votes
1
answer
201
views
Refresh the access token using redux-toolkit asyncThunks
import { createSlice, createAsyncThunk } from "@reduxjs/toolkit";
import axiosInstance from "../utils/axiosInstance";
export const logoutUser = createAsyncThunk(
"users/...
0
votes
0
answers
55
views
Handling State Updates for Cancelled Axios Requests with AbortController in React/Redux
I've integrated AbortController into my React application to cancel Axios requests as part of my state management with Redux. My setup includes dispatching actions to update the application state when ...
0
votes
0
answers
40
views
axios interceptor not updating my request for accessToken [duplicate]
(This question is extremely similar, only it seems sessionStorage isnt being recognized until refresh.
I am using react to send login details to my backend api and redux-persist stores my response ...
0
votes
1
answer
258
views
ReactJS Typescript how to trigger redux dispatch event from axios interceptor
I am newbie in ReactJS typescript, I want to call redux dispatch event whenever any api gets called (before and after), with axios interceptor.
Here is my code.
Codesandbax Repo
App.tsx
import "./...
0
votes
0
answers
33
views
fetching data in redux using Axios Get
The endpoint is http://127.0.0.1:8000/api and I can see the data if I go to that endpoint in my browser.
amazonslice.js
import { createSlice, createAsyncThunk } from "@reduxjs/toolkit";
...
0
votes
0
answers
62
views
React not sending api requests for fetching data(axios get)
ProductDetail page
const ProductDetail = () => {
const { id } = useParams();
const dispatch = useDispatch();
const history = useNavigate();
const productDetails = useSelector((state) => ...
-3
votes
1
answer
48
views
Delete icon does not delete the item 1st time, it takes two clicks to delete the item
The first time i click on delete, the id is undefined. But the id is available on 2nd click and it deletes the item.
Feed.js:
const Feed = ({ username }) => {
const dispatch = useDispatch();
...
5
votes
4
answers
15k
views
Automatically refreshing access token by AXIOS interceptor request
My React App uses Axios for API-requests.
Axios adds access token into headers every API-request by request interceptor. I want check expiry date before current request will be sent. If access token ...
0
votes
0
answers
109
views
How can I handle Axios erros with RTK?
I have service which send request to server by axios.
async login(query: LoginQuery) {
return await axios
.get<UserModel>(`${this._apiPath}${API_PATH.AUTH}${AUTH_API.LOGIN}`, {
...
0
votes
0
answers
86
views
cannot get token after refresh page (F5) redux-toolkit
i have token that send to global variable using redux
const initialState = {
user: null,
isError: false,
isSuccess: false,
isLoading: false,
message: ""
}
export const ...
0
votes
0
answers
62
views
My Redux persisted store is not persisting the state properly
I am creating a web app using Django as backend and React on frontend. Am pretty far ahead and almost ready to deploy on my staging server, currently just clearing some issues before I do that and I ...
-1
votes
1
answer
534
views
How i can fix error Cannot read properties of undefined (reading 'orderItems')?
i'm starting developing one webshop and i got this error.
This is my code:
import React, { useEffect } from "react";
import { Link } from "react-router-dom";
import Header from &...
0
votes
1
answer
177
views
Axios post file and json in the same request
I am trying to post 3 files and json to an API, I am just a bit confused on how to do it
export const postfunc = createAsyncThunk(
"dashbaord/postfunc ",
async (filesSelected, ThunkAPI) =...
0
votes
1
answer
512
views
Cancelling all request initiated from Axios instance
We are following the repository pattern in our project where we have a dataLayer file that takes care of instantiating Axios and setting up the baseURL. Like so:
const LcAPI = axios.create();
We also ...