RList.cons silently fails in JS

If so, what should I keep a reference to? It still fails when app, l, and h are global:

let l, h = RList.create []

let app =
  let out = l |> RList.map (fun x -> li [txt x]) |> R.Html.ul in
  let counter = ref 0 in
  div [
    button [txt "append"] ~a:[a_onclick (fun _ ->
      RList.cons (string_of_int !counter) h;
      incr counter;
      false
    )];
    out;
  ]