#Save State Always Dirty / Unsaved

4 messages · Page 1 of 1 (latest)

sour anvil
#

Hi. On every single collection I have the save state is always "unsaved". As soon as I hit the save button, it activates again and I can't leave any page without it saying I have unsaved progress. This is accross all collections.

payload version 3.47.0

pale rapids
#

Do you have custom components that you're loading into the edit view that could cause the save state to change?

sour anvil
#

yeah i actually just figured it out!

i was using React.useState unecssarily in the component

getting rid of it and only using
const { value, setValue } = useField({ path })

fixed the issue

For clarification: I had a custom component with a map that sets a location value on most of my collections (heavily location based app). My React brain instantly tossed a useState in to handle the visual updating of the component. I was doing things like useEffect on the state object and then updating the form value inside it... instead of just updating the form value directly and using it to fill the component.