You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Me query const [{data, fetching,}] = useMeQuery()
is called twice when the page. I tried removing the<React.StrictMode> but it still gets called twice.
it loads once with no data and then a second time with data and it makes a user component that I made blink. is there a way to wait for it to load and then check for the data or to check for the data before rendering the page? New to this thank you
The text was updated successfully, but these errors were encountered:
I noticed that too during my implementation. There is no drawback to this. It's not gonna tank your app performance since the request is only called once to the server. You can check by going to the Devtools > Network and checking all the graphql request and responses. The me query post request should appear once in the network tab. If you wanna experiment try wrapping it in a useEffect hook. Either way I would say not to worry about it since Ben makes a lot of changes regarding how the data is rendered from the server or client throughout the tutorial.
Thank you for the help, I also use the fetching that we destructured from the useMeQuery to make sure that my component doesn't display while it is fetching
The Me query
const [{data, fetching,}] = useMeQuery()
is called twice when the page. I tried removing the<React.StrictMode> but it still gets called twice.
it loads once with no data and then a second time with data and it makes a user component that I made blink. is there a way to wait for it to load and then check for the data or to check for the data before rendering the page? New to this thank you
The text was updated successfully, but these errors were encountered: