Replies: 1 comment 1 reply
-
I have two solutions, first convert to an array and use const conditionsList = conditions.getFieldset()
{Object.keys(schema.shape).map((type) => {
return (
<Box
key={type}
>
<Select
label={type}
defaultValue={conditionsList[type].initialValue}
name={conditionsList[type].name}
options={[
{ value: 'notRelevant', label: 'notRelevant' },
{ value: 'optional', label: 'optional' },
{ value: 'required', label: 'required' },
]}
/>
</Box>
);
})} I went up with the second one but i'd love if there is another way better that these solutions. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a dynamic object and not sure always sure ill get the same keys. you can certainly iterate over a
fieldList
as shown in the doc. but withfieldSet
given the same example from the doc and I don't always getzipcode
,country
for example, how to iterate dynamically?Beta Was this translation helpful? Give feedback.
All reactions