React-nonav needs the following dependencies; if you do not have those installed, you need to install them with the correspondig command:
Dependencie name | Yarn Installation command | NPM Installation command |
---|---|---|
rxjs | yarn add rxjs | npm i rxjs |
react-native-reanimated | yarn add react-native-reanimated | npm i react-native-reanimated |
Then, follow any post-installation instruction of react-native-reanimated
. See react-native-reanimated
Installation Instructions.
Then, install React-Nonav with:
yarn add react-nonav
or
npm i react-nonav
In order to create a canal, use the Canal
and Screen
components. Your screens order is important: the order is the elevation order. If two or more screens are visible, last visible in the array is shown.
That's all !
If you want to add full screen page, pass the isFullScreen
flag prop to your Screen
when creating a canal. In the following example, lastname
is a full screen page.
In order to render the full screen page, add the FullScreenPortal
at the top level in your rendering tree.
Back events are also managed in a declarative way. Use the onBack
callback prop on your screen.
You are ready to use React-Nonav 🎸.