on the GameGrid component, there have problem with the results
const fetchGameCount =
data?.pages.reduce((total, page) => total + page.results.length, 0) || 0;
in the results it’s showing “Property ‘results’ does not exist on type ‘TQueryFnData’”
I have tried multiple ways but not been solved yet.
Oh i did forget to mention at some point he goes back and refactors so depending on which part of the tutorial your at, you may not be implementing the same code yet
For me 9/10 times i make a type somewhere like a cap or underscore, depending on what the error is it may be an easy fix, try to paste your code in chat gpt and checking the error code on VScode. Remember that troubleshooting is a part of coding as well. I do remember 1 or 2 issues he resolves in a later video. Although if your find with moving on you can always pull my project from git later if there is too many problems, just remember use your own api key lol.
I have already tried with chatGPT but seems like it’s not a common error, when I tried to build it then it showed the error. you can watch my code here.
Thanks for your kind reply, Actually I am having problem in the useGames hooks when I am trying to build, it’s working good but when I trying to build then it’s showing the following error:
looks like you refrenced gameQuery instead of GameQuery which i think is the Props
const gameQuery = useGameQueryStore( s => s.GameQuery) //capital G
const gameQuery = useGameQueryStore(s => s.gameQuery); //error
It’s honestly a confusing thing having so many similar components, but remember if your creating a function when it refers to itself instead of an outside prop, it won’t bring the utility from another function.
Thanks for your kind reply, I solved this by using initialPageParam in useInfiniteQuery, In the course initialPageParam was not required as the reactQuery was version 4 but in version 5 the initialPageParam is required.