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
Uh oh!
There was an error while loading. Please reload this page.
-
I have a dynamic object and not sure always sure ill get the same keys. you can certainly iterate over a
fieldListas shown in the doc. but withfieldSetgiven the same example from the doc and I don't always getzipcode,countryfor example, how to iterate dynamically?Beta Was this translation helpful? Give feedback.
All reactions