We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3f9d526 commit b1cf727Copy full SHA for b1cf727
1 file changed
src/index.js
@@ -13,14 +13,14 @@ export default function DynamicForm({ formTemplate, onSubmit }) {
13
const mandatoryFields = formTemplate.data.filter(data => data.is_mandatory);
14
15
useEffect(() => {
16
+ formTemplate.data.sort((a, b) => a.index - b.index);
17
setFormFields({
18
...formFields,
19
...setDefaultForFields()
20
});
21
}, []);
22
23
- formTemplate.data.sort((a, b) => a.index - b.index);
24
const isValid = checkAllMandatoryFields();
25
setValid(isValid);
26
}, [JSON.stringify(formFields)]);
0 commit comments