Skip to content

Add value name to bindings #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions src/Navigation.re
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ external navigationContext: React.Context.t(t) = "NavigationContext";

let useNavigation = () => React.useContext(navigationContext);

[@bs.get] external state: t => NavigationState.t = "";
[@bs.get] external state: t => NavigationState.t = "state";

[@bs.send] external navigate: (t, string) => unit = "";
[@bs.send] external navigate: (t, string) => unit = "navigate";
[@bs.send]
external navigateWithParams: (t, string, Js.t({..})) => unit = "navigate";
[@bs.send] external goBack: t => unit = "";
[@bs.send] external goBackToRoute: (t, string) => unit = "";
[@bs.send] external getParam: (t, string) => Js.nullable('a) = "";
[@bs.send] external goBack: t => unit = "goBack";
[@bs.send] external goBackToRoute: (t, string) => unit = "goBackToRoute";
[@bs.send] external getParam: (t, string) => Js.nullable('a) = "getParam";
[@bs.send] external getParamWithDefault: (t, string, 'a) => 'a = "getParam";
[@bs.send]
external addListener:
Expand All @@ -37,10 +37,10 @@ external addListener:
// TODO: setParams, ...
// Stack Actions
// TODO: push, replace, ...
[@bs.send] external pop: t => unit = "";
[@bs.send] external popN: (t, int) => unit = "";
[@bs.send] external popToTop: t => unit = "";
[@bs.send] external pop: t => unit = "pop";
[@bs.send] external popN: (t, int) => unit = "popN";
[@bs.send] external popToTop: t => unit = "popToTop";
// Drawer navigator only
[@bs.send] external openDrawer: t => unit = "";
[@bs.send] external closeDrawer: t => unit = "";
[@bs.send] external toggleDrawer: t => unit = "";
[@bs.send] external openDrawer: t => unit = "openDrawer";
[@bs.send] external closeDrawer: t => unit = "closeDrawer";
[@bs.send] external toggleDrawer: t => unit = "toggleDrawer";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
[@bs.send] external toggleDrawer: t => unit = "toggleDrawer";
[@bs.send] external toggleDrawer: t => unit = "toggleDrawer";

4 changes: 2 additions & 2 deletions src/NavigationActions.re
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ external backParams:
"";

[@bs.module "react-navigation"] [@bs.scope "NavigationActions"]
external navigate: navigateParams => action = "";
external navigate: navigateParams => action = "navigate";

[@bs.module "react-navigation"] [@bs.scope "NavigationActions"]
external back: backParams => action = "";
external back: backParams => action = "back";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
external back: backParams => action = "back";
external back: backParams => action = "back";

3 changes: 2 additions & 1 deletion src/NavigationContainer.re
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
type t;
[@bs.send] external dispatch: (t, NavigationActions.action) => unit = "";
[@bs.send]
external dispatch: (t, NavigationActions.action) => unit = "dispatch";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
external dispatch: (t, NavigationActions.action) => unit = "dispatch";
external dispatch: (t, NavigationActions.action) => unit = "dispatch";