Should be able to remove the uploaded zip on error occurred, and removing the zip should not dirty the form.
Previously, I used the parser functions to transform the DB data from and to the form data type, but it seems it's not necessary and causing issues, since setting the form value to undefined does not clear the value change in React Hook Form. Therefore, changing it back to its original type definition CustomUiAssets | null and it solves the issue naturally.
Summary
Should be able to remove the uploaded zip on error occurred, and removing the zip should not dirty the form.
Previously, I used the parser functions to transform the DB data from and to the form data type, but it seems it's not necessary and causing issues, since setting the form value to
undefined
does not clear the value change in React Hook Form. Therefore, changing it back to its original type definitionCustomUiAssets | null
and it solves the issue naturally.Testing
Locally tested
Checklist
- [ ].changeset
- [ ] unit tests- [ ] integration tests- [ ] necessary TSDoc comments