Won't Work the defaultItems(1) on Repeater
i tried the defaultitems on a Repeater but it wont work why?


4 Replies
Is it an edit page? Defaults only work on create
its on my resource page
how to impelemnt the default item
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
Yes, but resources usually have create, edit and maybe view page. It only works on the create page.