How do you loop through an array of items in reason react… A small demo/ gist would be nice, Thanks
Iterate through array in reason react
Tevinthuku
#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
jchavarri
#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.