We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
const MyForm = ({FormDefinition, formData, onDesignChange}) => { const jsonSchemaFormRef = React.createRef<RJSF.default<any>>() const onChangeHandler = ({formdata}) => { jsonSchemaFormRef.current?.validate() if (jsonSchemaFormRef.current?.state.errors.length == 0){ onDesignChange(formData) } } return ( <JsonSchemaForm schema={formDefinition.schema as JSONSchema7 } uiSchema={formDefinition.uiSchema as JSONSchema7 } ref={jsonSchemaFormRef} // Ref is available on all react class elements onChange={onChangeHandler} formData={formData}> ) }
Should compile without any errors
Compiles with the following typescript errors
TS2339: Property 'errors' does not exist on type 'Readonly<{}>'.
TS2769: No overload matches this call. Overload 1 of 2, '(props: FormProps<any>, context?: any): ReactElement<any, any> | Component<FormProps<any>, any, any> | null', gave the following error. Type '{ children: any[]; schema: JSONSchema7; uiSchema: JSONSchema7; ref: RefObject<Form<any>>; formData: IPropertyPanelFormData | undefined; FieldTemplate: ({ id, children, displayLabel, rawErrors, rawHelp, rawDescription, }: FieldTemplateProps) => Element; onChange: DebouncedFunc<...>; }' is not assignable to type 'IntrinsicAttributes & FormProps<any>'. Property 'ref' does not exist on type 'IntrinsicAttributes & FormProps<any>'. Overload 2 of 2, '(props: PropsWithChildren<FormProps<any>>, context?: any): ReactElement<any, any> | Component<FormProps<any>, any, any> | null', gave the following error. Type '{ children: any[]; schema: JSONSchema7; uiSchema: JSONSchema7; ref: RefObject<Form<any>>; formData: IPropertyPanelFormData | undefined; FieldTemplate: ({ id, children, displayLabel, rawErrors, rawHelp, rawDescription, }: FieldTemplateProps) => Element; onChange: DebouncedFunc<...>; }' is not assignable to type 'IntrinsicAttributes & FormProps<any> & { children?: ReactNode; }'. Property 'ref' does not exist on type 'IntrinsicAttributes & FormProps<any> & { children?: ReactNode; }'.
2.4.0
The text was updated successfully, but these errors were encountered:
Fixed in the v5 beta, see the 5.x migration guide
Sorry, something went wrong.
No branches or pull requests
Prerequisites
Description
Steps to Reproduce
Expected behavior
Should compile without any errors
Actual behavior
Compiles with the following typescript errors
Version
2.4.0
The text was updated successfully, but these errors were encountered: