Open christenbc opened 11 months ago
https://github.com/fireship-io/fkit-course/blob/ce1b40a030c5461ba4e449a2c45eae6fdfcb4543/src/routes/%5Busername%5D/edit/%2Bpage.svelte#L24
bind:value={$formData.title} bind:value={$formData.url}
For some reason, are mutating the original
const formDefaults = { icon: 'custom', title: '', url: 'https://' };
this is an undesired behavior since
formData.set(formDefaults);
is setting the values to the previous once, hence the form is not being resetted.
What is going on?
I tested Object.freeze(formDefaults); is trying to be violated.
Object.freeze(formDefaults);
https://github.com/fireship-io/fkit-course/blob/ce1b40a030c5461ba4e449a2c45eae6fdfcb4543/src/routes/%5Busername%5D/edit/%2Bpage.svelte#L24
For some reason, are mutating the original
this is an undesired behavior since
formData.set(formDefaults);
is setting the values to the previous once, hence the form is not being resetted.
What is going on?