revalidatePath messing up modals
Answered
Mugger Crocodile posted this in #help-forum
Mugger CrocodileOP
https://privatebin.net/?3bdf45713177cc14#1zKVufprGbeePpzBUCpY9s3HjiTGNbrmmZMJEHNtTEn
^ form
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..
^ 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..
1 Reply
Mugger CrocodileOP
Fixed need to use useeffect
Answer