@@ -42,6 +42,7 @@ import {
4242 DEFAULT_ID_PREFIX ,
4343 GlobalFormOptions ,
4444 ERRORS_KEY ,
45+ NameGeneratorFunction ,
4546} from '@rjsf/utils' ;
4647import _cloneDeep from 'lodash/cloneDeep' ;
4748import _get from 'lodash/get' ;
@@ -195,6 +196,7 @@ export interface FormProps<T = any, S extends StrictRJSFSchema = RJSFSchema, F e
195196 * to put the second parameter before the first in its translation.
196197 */
197198 translateString ?: Registry [ 'translateString' ] ;
199+ nameGenerator ?: NameGeneratorFunction ;
198200 /** Optional configuration object with flags, if provided, allows users to override default form state behavior
199201 * Currently only affecting minItems on array fields and handling of setting defaults based on the value of
200202 * `emptyObjectFields`
@@ -994,10 +996,16 @@ export default class Form<
994996 experimental_componentUpdateStrategy,
995997 idSeparator = DEFAULT_ID_SEPARATOR ,
996998 idPrefix = DEFAULT_ID_PREFIX ,
999+ nameGenerator,
9971000 } = props ;
9981001 const rootFieldId = uiSchema [ 'ui:rootFieldId' ] ;
9991002 // Omit any options that are undefined or null
1000- return { idPrefix : rootFieldId || idPrefix , idSeparator, experimental_componentUpdateStrategy } ;
1003+ return {
1004+ idPrefix : rootFieldId || idPrefix ,
1005+ idSeparator,
1006+ ...( experimental_componentUpdateStrategy !== undefined && { experimental_componentUpdateStrategy } ) ,
1007+ ...( nameGenerator !== undefined && { nameGenerator } ) ,
1008+ } ;
10011009 }
10021010
10031011 /** Returns the registry for the form */
0 commit comments