Skip to main content
Version: 1.0.110

Navigation

Nano framework has inbuilt navigation that uses react-navigation.

Opening another screen:

All the methods like onPress, onLongPress, onStart and onEnd in framework has access to moduleParams parameter that has all the available modules, you can use navigation module from it like below.

For example, below is the code to move to another screen using navigate from navigation module.

const buttonPress = {
component: NANO.BUTTON,
value: 'CLICK ME TO MOVE TO SCREEN B',
onPress: ({ moduleParams }) => {
moduleParams["navigation"].navigate("ScreenB", { "name": "value" })
}
};

const screen = {
name: 'ScreenA',
screen: {
h1: [buttonPress],
}
};

You can use all the navigation methods like push, navigate, goBack and popToTop. Check the documentation here react-navigation