Open hisuwh opened 9 months ago
It looks like all the accessors are actually declared as just properties in the types. If there is no associated set
, then they are also marked as readonly.
In this instance, it is declared as readonly emptyValue: null;
whereas we would need it declared as get emptyValue(): null;
(or, ideally, to fix both issues, get emptyValue(): any;
)
Thank you for your contribution. As this issue has been inactive for over 90 days, I will close it for now. If you wish to reopen the issue, please respond and we can resume the triage process.
@Sidiro23 this is inactive because no one from formio has acknowledged it. We would like this resolved please.
@hisuwh Apologies, this ended up in the wrong queue. Re-opening the issue.
We've created a ticket for our dev team to review. In the meantime, we would be happy to review a pull request for this issue should one be created. Ticket for internal tracking: FIO-9131
I'm creating a custom component and need to override emptyValue to set the default to an array for my component (as per the example: https://help.form.io/developers/form-development/custom-components#checkmatrix-component).
However, Typescript is giving me errors:
I can resolve the first one by saying
return ([] as any);
But the only way around the second one is use
// @ts-ignore
or equiv which I don't like. Looking at the source I can see this is a property in the base so there must be an issue in the generated types. https://github.com/formio/formio.js/blob/master/src/components/_classes/component/Component.js#L2443