Children route loader not works with react-query
Hi, everyone, I'm following this two guides to build my react app with react-query and react-router-dom
https://tkdodo.eu/blog/react-query-meets-react-router
https://reactrouter.com/en/main/guides/data-libs
However, it appears that react-query's data loaded with one of my Root children's loader are not seen and it returns a failed request error.
The data loads only if i put inside the Root loader a ensureQueryData().
What is wrong with my code ?
myQuery.js :
---
Root.js :
---
PizzaPage.js :
---
App.js :
3 Replies
frail-apricot•3y ago
In
PizzaPage.js loader, I believe it should be:
dependent-tanOP•3y ago
Sorry, that was just a typo error i did writing this message. I edited it
Seems like only in my React app hosted on SAP it doesn’t load children loader data with axios istance custom baseURL. (maybe its that ? cause if i put the public tynicode api url it works). The app connect to db with vscode run configuration if can help to resolve tje question.
Instead -->
baseURL: "https://jsonplaceholder.typicode.com/"
I have --> baseURL: "DB_TELEKOM/My-App"
I recreated sandbox with this code but seems working.
https://codesandbox.io/s/boring-lichterman-kld8wk
only in my react app with axios custom url not work this. Very strangefrail-apricot•3y ago
Do you see the call in the netwok tab of the dev tools? What does it return?