@@ -29,7 +29,7 @@ export interface FormRendererProps<
2929 onReset ?: ( ) => void ;
3030 onError ?: ( ...args : any [ ] ) => void ;
3131 onSubmit ?: FormProps < FormValues , InitialFormValues > [ 'onSubmit' ] ;
32- schema : Schema ;
32+ schema : Schema | ( Record < string , any > & { fields : Array < Record < string , any > > } ) ;
3333 clearOnUnmount ?: boolean ;
3434 clearedValue ?: any ;
3535 componentMapper : ComponentMapper ;
@@ -107,7 +107,7 @@ function FormRenderer<
107107 ...props
108108} : FormRendererProps < FormValues , InitialFormValues , FTP > ) : ReactElement < any , any > {
109109 const [ fileInputs , setFileInputs ] = useState < string [ ] > ( [ ] ) ;
110- const formFields = useMemo ( ( ) => renderForm ( schema . fields ) , [ schema ] ) ;
110+ const formFields = useMemo ( ( ) => renderForm ( schema . fields as any ) , [ schema ] ) ;
111111 const registeredFields = useRef < Record < string , number > > ( { } ) ;
112112 const focusDecorator = useRef ( createFocusDecorator ( ) ) ;
113113 const validatorMapperMerged = useMemo ( ( ) => {
@@ -187,7 +187,7 @@ function FormRenderer<
187187 const validatorTypes = Object . keys ( validatorMapperMerged ) ;
188188 const actionTypes = actionMapper ? Object . keys ( actionMapper ) : [ ] ;
189189
190- defaultSchemaValidator ( schema , componentMapper , validatorTypes , actionTypes , schemaValidatorMapper ) ;
190+ defaultSchemaValidator ( schema as any , componentMapper , validatorTypes , actionTypes , schemaValidatorMapper ) ;
191191 } catch ( error : any ) {
192192 handleErrorCallback ( 'schema-error' , error ) ;
193193 return < SchemaErrorComponent name = { error . name } message = { error . message } /> ;
@@ -230,13 +230,13 @@ function FormRenderer<
230230 ffGetRegisteredFields : form . getRegisteredFields ,
231231 getRegisteredFields : internalGetRegisteredFields ,
232232 initialValues,
233- schema,
233+ schema : schema as any ,
234234 } ,
235235 } }
236236 >
237- { FormTemplate && < FormTemplate { ...( { formFields, schema, ...FormTemplateProps } as FTP ) } /> }
237+ { FormTemplate && < FormTemplate { ...( { formFields, schema : schema as any , ...FormTemplateProps } as FTP ) } /> }
238238
239- { children && renderChildren ( children , { formFields, schema } ) }
239+ { children && renderChildren ( children , { formFields, schema : schema as any } ) }
240240 </ RendererContext . Provider >
241241 ) }
242242 { ...props }
0 commit comments