Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ErrorSchema is a none deterministic type thus can't be used to accurately type Field components #2871

Closed
4 tasks done
Steffan-Ennis opened this issue May 30, 2022 · 1 comment
Assignees
Labels
bug needs triage Initial label given, to be assigned correct labels and assigned

Comments

@Steffan-Ennis
Copy link

Prerequisites

What theme are you using?

core

Version

4.1.1

Current Behavior

The type ErrorSchema is non deterministic

import { ErrorSchema } from '@rjsf/core'

const errorSchema: ErrorSchema = {
  __errors: [
    'This field is required'
  ]
}

raises the following compile error
Type 'string' is not assignable to type 'ErrorSchema'

Expected Behavior

The ErrorSchema type should be deterministic so it's usable when typing field components and testing those types

Steps To Reproduce

No response

Environment

- OS:
- Node:
- npm:

Anything else?

No response

@Steffan-Ennis Steffan-Ennis added bug needs triage Initial label given, to be assigned correct labels and assigned labels May 30, 2022
@heath-freenome
Copy link
Member

Fixed in the v5 beta, see the 5.x migration guide

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug needs triage Initial label given, to be assigned correct labels and assigned
Projects
None yet
Development

No branches or pull requests

4 participants