react-jsonschema-form
react-jsonschema-form copied to clipboard
Typing ErrorSchema claims subsequent fields 'are not assignable'
Prerequisites
- [X] I have searched the existing issues
- [X] I understand that providing a SSCCE example is tremendously useful to the maintainers.
- [X] I have read the documentation
- [X] Ideally, I'm providing a sample JSFiddle, Codesandbox.io or preferably a shared playground link demonstrating the issue.
What theme are you using?
utils
Version
5.21.2
Current Behavior
Typing ErrorSchema claims subsequent fields 'are not assignable'. The following is the relevant code and the full error message
Relevant code:
const userFormErrors: ErrorSchema<{ username: string }>=...
Error message:
Type '{ __errors: string[]; }' is not assignable to type 'ErrorSchema<string>'.
Type '{ __errors: string[]; }' is not assignable to type 'string'.
Full example is at https://codesandbox.io/p/sandbox/confident-framework-34wv6s
Expected Behavior
ErrorSchema should not throw errors when Typed
Steps To Reproduce
See full example at https://codesandbox.io/p/sandbox/confident-framework-34wv6s
The following error is visible in the "problems" pane
Type '{ __errors: string[]; }' is not assignable to type 'ErrorSchema<string>'.
Type '{ __errors: string[]; }' is not assignable to type 'string'.
Environment
https://codesandbox.io/p/sandbox/confident-framework-34wv6s
Anything else?
No response