rescript-react-native / rescript-react-navigation

ReScript bindings for React Navigation
MIT License
74 stars 28 forks source link

Add the addListener binding. #9

Closed Natim closed 5 years ago

Natim commented 5 years ago

r? @MoOx

Natim commented 5 years ago

For the lastState and the state variable do you know what type to set?

cknitt commented 5 years ago

The TypeScript definitions have

export interface NavigationEventPayload {
  type: EventType;
  action: NavigationAction;
  state: NavigationState;
  lastState: NavigationState | null | undefined;
}

So I think it should be NavigationState.t / option(NavigationState.t).

cknitt commented 5 years ago

Actually, if it can really be null and not just undefined, we need Js.Nullable.t(NavigationState.t).

Natim commented 5 years ago

Thank you for bearing with me while I am starting with ReasonML.

I have the following error:

src/Navigation.re 33:3-21

  31 ┆   navigationEventPayload => unit
  32 ┆ ) =>
  33 ┆ EventSubscription.t =
  34 ┆ "addListener";
  35 ┆ 

  The module or file EventSubscription can't be found.

but reason-react-native seems to be in bsconfig.json nonetheless any idea how to make it visible?

open ReactNative; fixed it!