The documentation for ReasonReact specifies where in the code a type should be declared:
The state type could be anything! An int, a string, a ref or the common record type, which you should declare right before the
reducerComponent
call:type state = {counter: int, showPopUp: bool}; let component = ReasonReact.reducerComponent "Dialog";
The emphasis is theirs.
Why would it matter where the type declaration is located, so long as it's valid? Does some kind of optimization take place only when the two lines are adjacent? What happens if I insert other things between them or put them in separate modules?
The type needs to be defined before it is used, but it doesn't matter in any technical sense whether there's anything in between. That's just convention, to keep related things together.
I'll see about getting this clarified in the docs.