It's manager for your pages like mobile app.
For example: In the render function return
<Navigator onRef={ref => (this.navigatorRef = ref)} >
<MyHomePage key="home" levelPage={0} />
<AboutPage key="about"
levelPage={1}
/>
</Navigator>
Note: prop levelPage important to manage the returs (from back button) in the structure of a tree
To change page you get the ref and do:
the option to changePage it's:
this.navigatorRef.changePage(
goToPage //Required
,{options}// Not requred
);
options => { animationIn:integer // have defult , animationOut:string // have defult , timeAnimationInMS:integer // defult=250(ms) , callbackFun:function , props:{...} }
*animationIn and animationOut need name animate from https://daneden.github.io/animate.css/
*the animate.css includ in this package
| prop | type | required | defult | node |
|---|---|---|---|---|
| onRef | required | - | onRef={ref => (this.navigatorRef = ref)} | |
| key | string | required | - | |
| height | string or integer | optional | "100%" | |
| onChangePage | function | optional | - | (nowPageKey,levelAction) => { ... } |
| beforChangePage | function | optional | - | (goToPageKey,levelAction) => { ... } |
| homePageKey | string | optional | The key of the first child | (nowPageKey,levelAction) => { ... } |
| prop | type | required | defult | node |
|---|---|---|---|---|
| levelPage | integer | required | - | important! |
| backgroundColor | string | optional | #fff | |
| height | string or integer | optional | "100%" | |
| backOnSwipeRight | boolean | optional | false | |
| alwaysLive | boolean | optional | false | Don't kill the child. Life is always in the background |
const nowPage= this.navigatorRef.nowPage;
const historyPages= this.navigatorRef.historyPages();
const listLevelPages= this.navigatorRef.listLevelPages();
this.navigatorRef.back();
const navigator_busy= this.navigatorRef.busy;
*busy return boolean
Credit:
Arik Wald
Credit animated:
animate.css -https://daneden.github.io/animate.css/