Our official documentation refers to a number type for the value argument (see docs). However, we can in fact support both string and number (and that's what we defined when migrating to TypeScript and helped us figure out the issue - see PR). Plus, the documentation also mentions that the value should be updated using the update function argument, which for now only returns a string.
It seems we have a wobbly API for our component, as it requires us to parse the value returned by the update function before using it to set our new value.
A suggestion could be the following:
interface AmountInputArgs {
...
- update: (value: string) => void;
- value: number | string;
+ update: (value: number) => void;
+ value: number;
}
Note that if the suggestion is accepted and implemented, it will be a breaking change.
Our official documentation refers to a
numbertype for thevalueargument (see docs). However, we can in fact support bothstringandnumber(and that's what we defined when migrating to TypeScript and helped us figure out the issue - see PR). Plus, the documentation also mentions that thevalueshould be updated using theupdatefunction argument, which for now only returns astring.It seems we have a wobbly API for our component, as it requires us to parse the value returned by the
updatefunction before using it to set our newvalue.A suggestion could be the following:
interface AmountInputArgs { ... - update: (value: string) => void; - value: number | string; + update: (value: number) => void; + value: number; }Note that if the suggestion is accepted and implemented, it will be a breaking change.