For some reason now it works properly.
NOTE: this solution is unstable and can change in the future.
This commit is contained in:
@@ -9,9 +9,7 @@ async function editContact(contactId: string, formData: FormData) {
|
|||||||
"use server";
|
"use server";
|
||||||
const updates = Object.fromEntries(formData);
|
const updates = Object.fromEntries(formData);
|
||||||
await updateContact(contactId, updates);
|
await updateContact(contactId, updates);
|
||||||
revalidatePath('/(sidebar)', 'layout');
|
revalidatePath('/(sidebar)', 'layout'); // THE NESTED BEHAVIOR IS UNSTABLE AND CAN CHANGE IN FUTURE.
|
||||||
revalidatePath(`/contacts/${contactId}`, 'page');
|
|
||||||
revalidatePath(`/contacts/${contactId}/edit`, 'page');
|
|
||||||
redirect(`/contacts/${contactId}`); // This makes the server component data be reloaded.
|
redirect(`/contacts/${contactId}`); // This makes the server component data be reloaded.
|
||||||
/*
|
/*
|
||||||
* The server component architecture is a HTMX-like structure where the component rendered is STATE-LESS
|
* The server component architecture is a HTMX-like structure where the component rendered is STATE-LESS
|
||||||
|
|||||||
Reference in New Issue
Block a user