Skip to main content
The 2024 Developer Survey results are live! See the results

All Questions

-1 votes
1 answer
325 views

Issue with Redirecting After Logout Using TanStack Query in React

I'm trying to implement user state management with tanstack query instead of using react context. Right now i can log in and im redirected successfuly to my home page. However when i logout i ...
Tamas Sallai's user avatar
0 votes
1 answer
55 views

after making the routes protected, I got stuck in the login page although the login was successful [duplicate]

I'm protecting my routes using <ProtectedRoutes/>, the scenario is to navigate the user after the successful login to the /dashboard, the problem is no matter how many times I loged in ...
Marya's user avatar
  • 119
0 votes
0 answers
472 views

React Query Prefetching Not Working As Expected

I've just started converting my application over to use react query. I'm new to using this library, so I'm not sure if I'm misunderstanding how this is supposed to work, but it seems to me like the ...
George Nassar's user avatar
1 vote
2 answers
672 views

React Router creating a Route with a path defined by an API array of objects blocked by React Query

I am using React-Query besides React-Router and I can not extract the data with React-Query in App.jsx. function App() { const { isLoading, software } = useSoftware(); return ( <...
Chicot's user avatar
  • 59
0 votes
0 answers
321 views

Status does not change - React-Query useInfiniteQuery with React-Router loader

I have a React project, I use React-Router 6.15.0 with loaders and query data with useInfiniteQuery in my component with React-Query. I need to make a loading indicator in another component, I want to ...
Yannik195's user avatar
0 votes
1 answer
2k views

Why does the ' Uncaught TypeError: Cannot read properties of undefined' error occur?

export default function VideoDetail() { const { etag } = useParams(); const { isLoading, error, data: test, } = useQuery(["test"], async () => { return fetch(".....
white's user avatar
  • 45
0 votes
1 answer
134 views

Is it impossible to query multiple times in one project?

I'm making YouTube by myself. I fetched the json file from the first page and got the data normally, export default function VideoHome() { const { isLoading, error, data: popular, } = ...
white's user avatar
  • 45
1 vote
0 answers
937 views

Setting up Access Token Middleware in React when using a hook/context provider for your token

tl;dr: How does one go about setting up a hook to handle token headers across axios api calls in a meaningfully maintainable way, with the assumption that the token itself is exposed as a hook. I am ...
iamaword's user avatar
  • 1,439
2 votes
1 answer
217 views

React-Query / React Router V5 insert state variable from api response into route but only when response has finished

In my app, I have an api call which gets some data (Array of objects), I then use this in a context and share this across my app. What I want to do is use some of that data i.e object value and prefix ...
Sole's user avatar
  • 3,280
-1 votes
1 answer
732 views

An initial query still showing on React Query Dev Tools

Hello There! Here you can see a minimal reproducible example of the issue: https://codesandbox.io/s/cool-breeze-gdlsbu?file=/src/Discover.js I've been trying to solve this issue: If you search for ...
Orleydovsky's user avatar
6 votes
0 answers
3k views

Handling errors in React (Error Boundary, React-Query, Axios Interceptor)

I have a Create React App (that uses react-router v6) that is setup the following way to communicate with the API. At the top level - I wrapped my app in an ErrorBoundary (Sentry.ErrorBoundary). When ...
feyndev's user avatar
  • 132
2 votes
2 answers
898 views

Manage with React api query useState Hook

After creating useState Hook For gender, age useState('30'); useState('female'); If you set http://api.minsu.com/product/${id}?gender=feamle&age=30 I am using react-query(useQuery) for api state ...
ssksksks's user avatar
  • 209
2 votes
1 answer
5k views

React router / react query does not cancel/make request on navigation - React/ typescript

In my app, I am using react-router v5 and react/typescript I have a component that uses the react-query and fetches some data. At the moment it only fetches the data when the component is rendered the ...
Sole's user avatar
  • 3,280
3 votes
1 answer
6k views

How to redirect to homepage using React Router and React Query

I have an app that displays a list of invoices. On clicking through to an individual invoice page, you have the option to delete that invoice. On clicking delete, a modal pops up to confirm the delete ...
user8006446's user avatar
1 vote
1 answer
3k views

React query shows previous page data in new page

I have a react project including two pages: blog and gallery. I can fetch data with react-query and navigate between pages with react-router. The problem is when I navigate from blog to gallery (and ...
Shahriar's user avatar
  • 2,285

15 30 50 per page