Next.js Discord

Discord Forum

How to avoid revalidation on client component.

Unanswered
Turkish Angora posted this in #help-forum
Open in Discord
Turkish AngoraOP
I'm using getItems action in a client component (combobox). That is located in a related view /things/[id].

I update some items in client component that is used in /things/[id] page. (need ability to multiselect, so each item has it's own loading state and uses updateItem action from /items/actions.ts).

If I go back to /items page (list of all items, and relationship counter), data is stale.

If I add revalidatePath("/items") to updateItem action, than problem is fixed, but I get different problem, my combobox client component re-renders on each reavalidatePath call. How can I avoid that?

0 Replies