In an array object schema the default value is partially ignore if the object schema contains optional keys.
const doc = syncroState({
schema: {
optionalInternal: y.array(y.object({
value: y.string().optional()
})).default([{ value: 'A' }, {value: 'B'}, {value: 'C'}]),
}
})
In the above example the value of doc.optionalInternal initially is an empty array instead of the defined default value. If the key inside the object is nullable or "required" the state is matching expectation.
Reproduction
https://svelte.dev/playground/0afcdaa991bf4a15b5e947886cac53b0?version=latest
Additional information
A simpler array schema matches my expectation of how this should behave
y.array(y.string().optional()).default(['1','2']) // ['1','2']