Next.js Discord

Discord Forum

revalidatePath messing up modals

Answered
Mugger Crocodile posted this in #help-forum
Open in Discord
Mugger CrocodileOP
https://privatebin.net/?3bdf45713177cc14#1zKVufprGbeePpzBUCpY9s3HjiTGNbrmmZMJEHNtTEn
^ form

<div className="mt-4 w-full">
        {animal.generalNotes.map((note, index) => (
          <div key={index}>
            <Note note={note}></Note>
          </div>
        ))}
      </div>
<- Mapping through each note.

When I use revalidate in the server action, the database query gets executed so the order of the generalNotes changes. The modal still opens the before one.. If I remove revalidate, it works fine but the page's title doesnt update..
Answered by Mugger Crocodile
Fixed need to use useeffect
View full answer

1 Reply

Mugger CrocodileOP
Fixed need to use useeffect
Answer