getDefaultFormState() takes a SchemaContext and a props object
Detect
- In your code, a call to
getDefaultFormState()imported from@rjsf/utilswith positional arguments after thevalidator. - The type checker reports
Expected 2 arguments, but got 5.(TS2554, with your argument count) on the call.
Change
getDefaultFormState() had the longest list of optional parameters, most of them easy to pass in the wrong order. It now takes a SchemaContext followed by a GetDefaultFormStateProps object:
-getDefaultFormState(validator, schema, formData, rootSchema, false, defaultFormStateBehavior, customMergeAllOf, undefined, uiSchema);
+getDefaultFormState({ validator, customMergeAllOf, defaultFormStateBehavior }, { schema, formData, rootSchema, uiSchema });
Its props are schema, formData?, rootSchema?, includeUndefinedValues?, initialDefaultsGenerated?, uiSchema? and uiSchemaDefinitions?, with the same meanings and defaults the positional parameters had.
SchemaUtilsType.getDefaultFormState() is unchanged.
Verify
The type checker accepts the call, and it returns the same defaults as before.
Also read: