Skip to content
This repository has been archived by the owner on Apr 7, 2021. It is now read-only.

Latest commit

 

History

History
71 lines (57 loc) · 1.56 KB

navigation.en.md

File metadata and controls

71 lines (57 loc) · 1.56 KB

🇬🇧 (EN | RU)

Navigation between panels

All navigation is done by using functions on the Navigator object.

To navigate to a different panel you can use navigator.go:

function showAbout() {
  navigator.go("about");
}

you can also pass parameters to the panel (will be available via navigator.params):

function showProductDetails() {
  navigator.go("details", { id: productId });
}

Other useful thing is going to the previous panel (for back buttons) which can be done using navigator.goBack:

return (
  <PanelHeader left={<PanelHeaderBack onClick={navigator.goBack} />}>
    ...
  </PanelHeader>
);

Navigation between views

This is done by using navigator.changeView:

function toAnotherView() {
  navigator.changeView("another-view");
}

Parameters can be passed as well (will be available via navigator.viewParams):

function toAnotherView() {
  navigator.changeView("another-view", { spam: "eggs" });
}

API

go(panelId: string, params?: any): void
Name Description
panelId Required. Target panel ID
params Custom parameters to pass

goBack(): void

changeView(viewId: string, params?: any): void
Name Description
viewId Required. Target View ID
params Custom parameters to pass

← Basics