Closed
Description
The current example is incorrect. In the let items binding it is taking a list and converting it to an array and then trying to pipe it to a function that takes a list.
type todo = {id: string, text: string}
let todoList = list{
{id: "todo1", text: "Todo 1"},
{id: "todo2", text: "Todo 2"}
}
let items =
todoList
->Belt.List.toArray
->Belt.List.map((todo) => { // <------- I believe this should be Belt.Array.map and not Belt.List.map
<li key={todo.id}>
{React.string(todo.text)}
</li>
})
<div> {React.array(items)} </div>
Metadata
Metadata
Assignees
Labels
No labels