I am working with a Json array that looks like this:
[{"name":"ip","children":{"label":"ip","value":"","type":"text","validation":"{ required: true}"}}
,{"name":"test","children":{"label":"test","value":"","type":"text","validation":"{ required: true}"}}
,{"name":"join","children":{"label":"join","value":"","type":"text","validation":"{ required: true}"}}
,{"name":"myform","children":{"label":"myform","value":"","type":"text","validation":"{ required: true}"}}]
Now, I need to pass an object to the component in this format:
export const person = {
ip: {
label: 'ip',
value: '',
type: 'text',
validation: { required: true }
},
test: {
label: 'test',
value: '',
type: 'text',
validation: { required: true }
},
join: {
label: 'join',
value: '',
type: 'text',
validation: { required: true }
},
myform: {
label: 'myform',
value: '',
type: 'text',
validation: { required: true }
}
}
Can someone help me achieve this?