Pages is undefined when I enter the page through a link, <Link> tag or react-router-dom's navigate()
When I access a page where useInfiniteQuery is being used, through a link that was present on another page, either the <Link /> tag or the react-router-dom navigate, I am receiving an error message. When I reload the page, the error disappears and I can use the page normally without any problems. A palliative adjustment I made was to place a window.location.reload() after navigate.
I checked and my API is returning the data correctly and in the appropriate format.
I isolated the query on another page of my application with just a console.log to check the query results and the error continued to occur when accessing it through a link.
Error Message:
0 Replies