State Management · Middle · Question 66 of 75

How can you make opening a detail page feel instant?

<Link to={`/posts/${id}`} onMouseEnter={() => queryClient.prefetchQuery(postQuery(id))}>

Explanation

Prefetching respects staleTime, so repeated hovers don't spam the server. Routers with loaders can call ensureQueryData similarly.

Further reading

Problem with a question

State Management · Middle · question 66

Test yourself

Take the State Management · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz