title: Unbound record field id error
body: <p>I am trying out Reason-React. I am facing a problem when I try to add a key to one of the components.</p>
  <p>I have a TodoApp that takes a list of TodoItem as state. The app works fine when I don't have a key for the TodoItem. When I add it, however I am getting a compilation error. I am adding the files here for reference:</p>
  <p>TodoItem.re:</p>
  <pre><code>type item = {
    id: int,
    title: string,
    completed: bool
  };
  
  let lastId = ref(0);
  
  let newItem = () =&gt; {
    lastId := lastId^ + 1;
    {id: lastId^, title: &quot;Click a button&quot;, completed: false}
  };
  
  let toString = ReasonReact.stringToElement;
  
  let component = ReasonReact.statelessComponent(&quot;TodoItem&quot;);
  
  let make = (~item, children) =&gt; {
    ...component,
    render: (self) =&gt;
      &lt;div className=&quot;item&quot;&gt;
        &lt;input _type=&quot;checkbox&quot; checked=(Js.Boolean.to_js_boolean(item.completed)) /&gt;
        (toString(item.title))
      &lt;/div&gt;
  };
  </code></pre>
  <p>TodoApp.re:</p>
  <pre><code>let toString = ReasonReact.stringToElement;
  
  type state = {items: list(TodoItem.item)};
  
  type action =
    | AddItem;
  
  let component = ReasonReact.reducerComponent(&quot;TodoApp&quot;);
  
  let currentItems = [TodoItem.{id: 0, title: &quot;ToDo&quot;, completed: false}];
  
  let make = (children) =&gt; {
    ...component,
    initialState: () =&gt; {items: currentItems},
    reducer: (action, {items}) =&gt;
      switch action {
      | AddItem =&gt; ReasonReact.Update({items: [TodoItem.newItem(), ...items]})
      },
    render: ({state: {items}, reduce}) =&gt; {
      let numOfItems = List.length(items);
      &lt;div className=&quot;app&quot;&gt;
        &lt;div className=&quot;title&quot;&gt;
          (toString(&quot;What to do&quot;))
          &lt;button onClick=(reduce((_evt) =&gt; AddItem))&gt; (toString(&quot;Add Something&quot;)) &lt;/button&gt;
        &lt;/div&gt;
        &lt;div className=&quot;items&quot;&gt;
          (
            ReasonReact.arrayToElement(
              Array.of_list(
                (List.map((item) =&gt; &lt;TodoItem key=(string_of_int(item.id)) item /&gt;, items))
                /*List.map((item) =&gt; &lt;TodoItem item /&gt;, items) This works but the above line of code with the key does not*/
              )
            )
          )
        &lt;/div&gt;
        &lt;div className=&quot;footer&quot;&gt; (toString(string_of_int(numOfItems) ++ &quot; items&quot;)) &lt;/div&gt;
      &lt;/div&gt;
    }
  };
  </code></pre>
  <p>I've added a comment near the line where the error occurs.</p>
  <p>The error reads as <code>Unbound record field id</code>, but I am not able to figure out how it is not bound. What am I missing here?</p>