React json form schema- To remove fields in onChange

169 views Asked by At

How to remove some fields, depends on the input I got for a field (in onChange) in react json form schema.

I have used readOnly=true. It doesn't work

For example: If I get eventprocessingeventcomstatusidid as 1, need to remove this field 'eventprocessingeventcostidid' from my form.

const changingSchema = (formData, p) => { if (formData.formData.eventprocessingeventcomstatusidid == 1) { eventProcessingFormSchema.properties.eventprocessingeventcostidid.readOnly = true; setEventProcessingUIFormSchema(eventProcessingUIFormSchema); }

I tried this way,it doesn't change into readOnly quickly. After I gave input,it will change into readonly format

0

There are 0 answers