Description
Scope: FormRenderer
Description: When initialValues is set to a static object like initialValues={{type: {label: "test", value: "1"}}}
, it correctly initialises the value but when the same data comes in from an API call and is passed to initialValues
prop it fails to initialise it correctly. The useFormApi
is correctly getting the initialValues but it does not pass through to the fields.
Schema: fields: [ { component: 'radio', name: 'type', label: 'Type', actions: { options: ['getTypes'], }, }]
Renderer code
<FormRenderer componentMapper={componentMapper} FormTemplate={FormTemplate} actionMapper={actionMapper} schema={schema} onSubmit={asyncSubmit} onCancel={() => console.log('Cancelling')} onReset={() => console.log('Resetting')} initialValues={dataFromApi} //{type: {label: "test", value: "1"}} subscription={{ values: true, initialValues: true }} />