leomayleomay
6/26/2018 - 3:38 AM

test.re

type state = {
  myListRef: ref(option(ReasonReact.reactRef)),
};

let setListRef = (theRef, {ReasonReact.state}) =>
  state.myListRef := Js.Nullable.toOption(theRef);

let make = (~goBack: unit => unit, ~showLogin: unit => unit, _children) => {
  ...component,
  initialState: () => {
    myListRef: ref(None),
  },
  render: (self) => {
    <FlatList
      ref=(self.handle(setListRef))
    />
  }
}