Iterate through array in reason react

reasonreact

#1

How do you loop through an array of items in reason react… A small demo/ gist would be nice, Thanks


#2

This doesn’t seem to work

          (
            ReasonReact.array(
              Array.map(
                step =>
                  <Step key=step.label>
                    <Steplabel> (ReasonReact.string(step.label)) </Steplabel>
                  </Step>,
                steps,
              ),
            )
          )

Im receiving the props from a js file as an array


#3

There is ReasonReact.arrayToElement to convert an array to a React element. In the latest version of ReasonReact, it’s been renamed to ReasonReact.array.

Here’s an example.