Next.js Discord

Discord Forum

RevalidatePath and delay on UI Update.

Unanswered
Yellow croaker posted this in #help-forum
Open in Discord
Original message was deleted.

7 Replies

Yellow croaker
I would expect that the new workExperience (lisää työkokemus) appears same time as the button loading ends, or atleast almost same time, but now it seems to have quite long delay 2-3 second?
Yellow croaker
Allright this got fixed?

Im using mantine and i added useDisclousure instead of useState and it suddenly started working
 //const [isLoading, setIsLoading] = React.useState<boolean>(false);
  const [loading, { toggle }] = useDisclosure();

  async function onClick() {
    //setIsLoading(true);
    toggle();
    const value = await createAction(initialPayload);
    toggle();
    // setIsLoading(false);
    console.log('valmis', value);
    // Timeout duration in milliseconds
  }
Yellow croaker
There still seems to be quite long load times on certain parts of the code where i update the database, but that is probabyl normal?
Yellow croaker
Anyone got suggestion how to deal with this kind problem. This seems to occur on few different places on My project.
-loading indicator stops showing loading state, 1-2 second later ui updates with revalidatepath.
There Time between The loading state being ready and updating ui is too long
This was not a problem when i had local database, but now i'm using vercel postgres database and this problem occured.
Yellow croaker
Bump
Yellow croaker
Bump, still facing this kind problem