Won't Work the defaultItems(1) on Repeater

i tried the defaultitems on a Repeater but it wont work why?
No description
No description
4 Replies
Dennis Koch
Dennis Koch3w ago
Is it an edit page? Defaults only work on create
J3R1CH0
J3R1CH0OP3w ago
its on my resource page how to impelemnt the default item
charlie
charlie3w ago
Your code seems right, but it won't work when you edit record, only when you create one, because when you edit the record it will fetch repeater data from db and if it's null, the empty repeater won't show. (like Dennis said) However it should have one default empty item on create record page. If you absolutely need the repeater item to show on edit page when value is null, you'll need to format the state on hydration from null to an empty array or something like that
Dennis Koch
Dennis Koch3w ago
Yes, but resources usually have create, edit and maybe view page. It only works on the create page.

Did you find this page helpful?