@@ -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`
@@ -985,10 +987,16 @@ export default class Form<
985
987
experimental_componentUpdateStrategy,
986
988
idSeparator = DEFAULT_ID_SEPARATOR ,
987
989
idPrefix = DEFAULT_ID_PREFIX ,
990
+ nameGenerator,
988
991
} = props ;
989
992
const rootFieldId = uiSchema [ 'ui:rootFieldId' ] ;
990
993
// Omit any options that are undefined or null
991
- return { idPrefix : rootFieldId || idPrefix , idSeparator, experimental_componentUpdateStrategy } ;
994
+ return {
995
+ idPrefix : rootFieldId || idPrefix ,
996
+ idSeparator,
997
+ ...( experimental_componentUpdateStrategy !== undefined && { experimental_componentUpdateStrategy } ) ,
998
+ ...( nameGenerator !== undefined && { nameGenerator } ) ,
999
+ } ;
992
1000
}
993
1001
994
1002
/** Returns the registry for the form */
0 commit comments