How to fetch by useQuery on page load. #4536
-
I want to fetch data on page loaded, like this we used to wrote code... useEffect(() => {
axios.get(
"https://jsonplaceholder.typicode.com/posts"
);
}, []) I prepare sample code. https://github.com/theMistletoe/tanstack-vite-sample/tree/main maybe, I make a mistake. This sample is similar to my app’s working. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I don't understand the question. your code looks fine ... |
Beta Was this translation helpful? Give feedback.
I don't understand the question. your code looks fine ...