@@ -43,6 +43,7 @@ import {
43
43
DEFAULT_ID_SEPARATOR ,
44
44
DEFAULT_ID_PREFIX ,
45
45
GlobalFormOptions ,
46
+ NameGeneratorFunction ,
46
47
} from '@rjsf/utils' ;
47
48
import _cloneDeep from 'lodash/cloneDeep' ;
48
49
import _forEach from 'lodash/forEach' ;
@@ -198,6 +199,7 @@ export interface FormProps<T = any, S extends StrictRJSFSchema = RJSFSchema, F e
198
199
* to put the second parameter before the first in its translation.
199
200
*/
200
201
translateString ?: Registry [ 'translateString' ] ;
202
+ nameGenerator ?: NameGeneratorFunction ;
201
203
/** Optional configuration object with flags, if provided, allows users to override default form state behavior
202
204
* Currently only affecting minItems on array fields and handling of setting defaults based on the value of
203
205
* `emptyObjectFields`
@@ -975,10 +977,16 @@ export default class Form<
975
977
experimental_componentUpdateStrategy,
976
978
idSeparator = DEFAULT_ID_SEPARATOR ,
977
979
idPrefix = DEFAULT_ID_PREFIX ,
980
+ nameGenerator,
978
981
} = props ;
979
982
const rootFieldId = uiSchema [ 'ui:rootFieldId' ] ;
980
983
// Omit any options that are undefined or null
981
- return { idPrefix : rootFieldId || idPrefix , idSeparator, experimental_componentUpdateStrategy } ;
984
+ return {
985
+ idPrefix : rootFieldId || idPrefix ,
986
+ idSeparator,
987
+ ...( experimental_componentUpdateStrategy !== undefined && { experimental_componentUpdateStrategy } ) ,
988
+ ...( nameGenerator !== undefined && { nameGenerator } ) ,
989
+ } ;
982
990
}
983
991
984
992
/** Returns the registry for the form */
0 commit comments