I am trying to print data inside a nested map function. For some reason it does not print anything. here is what I have:
{dataFormat.protein_questions.map((item, index) => (
<div key={_.uniqueId()} className="item">
<div className="inline fields">
<Field
onChange={handleChange}
name={`protein_question[${index}].units_of_measurement`}
component="select"
className="ui dropdown2"
required>
{item.typing_methods.map((method, methodIndex) => {
method.unitsOfMeasurement.map((unit, unitIndex) => (
<option value={unit.title}>{unit.title}</option>
));
})}
</Field>
</div>
</div>
))}
The options are not printing any data inside the select for some reason. When I console log the data inside the nested loop it shows fine. Anyone know why this is happening?
By the way this is inside my render function in a JSX view file.
item.typeing_methods.map, so I am not sure what you are expecting(and not{, the first will implicitely return the statement, the second expects a return