-
Screen.Recording.2025-04-08.at.18.58.29.movWhen I use: https://nuqs.47ng.com/docs/server-side (the text above in the video), it seems slow and delayed to display a context, but when I use useQueryState (components changing below as I navigate) it's much faster. I'd like to avoid useQueryState to keep fetching server-side lower in my component tree here is my code: // searchParams.tsx
import {
createSearchParamsCache,
parseAsString,
} from 'nuqs/server';
export const searchParamsCache = createSearchParamsCache({
content: parseAsString.withDefault('overview').withOptions({ shallow: false }),
}); //page.tsx
const { content } = await searchParamsCache.parse(props.searchParams); Am I doing something wrong? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You're not doing anything wrong: state updates are optimistic, and so will naturally feel faster on the client than doing a round-trip to the server. You can exacerbate the problem by throttling your network connection in the devtools, to simulate additional latency. Hard to say without seeing the whole page, but you could try having those tabs being part of the pathname rather than the search params, for faster navigation. |
Beta Was this translation helpful? Give feedback.
You're not doing anything wrong: state updates are optimistic, and so will naturally feel faster on the client than doing a round-trip to the server.
You can exacerbate the problem by throttling your network connection in the devtools, to simulate additional latency.
Hard to say without seeing the whole page, but you could try having those tabs being part of the pathname rather than the search params, for faster navigation.