salt-ds
salt-ds copied to clipboard
Input `inputProps` errors when data attribute is provided
Area
UI Components
The problem
When passing 'data-testid' in inputProps
. In satl-ds it gives TS error
TS2353: Object literal may only specify known properties, and '['data-testid']' does not exist in type 'InputHTMLAttributes<HTMLInputElement>'.
The solution
?
Whether TypeScript / React itself has types we can use
Alternatives and examples
MUI supports it by
// Accommodate arbitrary additional props coming from the `inputProps` prop
[arbitrary: string]: any;
Are you a JPMorgan Chase & Co. employee?
- [X] I am an employee of JPMorgan Chase & Co.