Hi I've noticed that the
payload-typesgenerated for
arrayfields always have an optional
id?: string.
From what I've seen, ids are always automatically generated for array items. Is it safe to assume they will always be generated? And if not, when are they not generated?
I'm asking because I plan to do
key={option.id}in my React front end
When is an
idundefined on a row of an
arrayfield?
I think it's so you can use the same type for type safe create. I could be wrong, but to me it's the only logical scenario when
idwould not exist
Thanks for the reply
@93699784942034944, that makes a lot of sense and I think you're right
Star
Discord
online
Get dedicated engineering support directly from the Payload team.