Toast
Nano framework has inbuilt toast
that uses react-native-toast-message.
Showing Toast:
All the methods like onPress
, onLongPress
, onStart
, onResume
, onPause
and onEnd
in framework has access to moduleParams parameter that has all the available modules, you can use toast
module from it like below.
For example, below is the code to show toast on screen using show
method from toast
module.
const buttonPress = {
component: NANO.BUTTON,
value: 'CLICK ME TO SHOW TOAST',
onPress: ({ moduleParams }) => {
const toast = moduleParams["toast"]
toast.show({
type: 'success',
text1: 'Logged In',
text2: 'Loged in Successfully',
position: "bottom"
});
}
};
const screen = {
name: 'Screen',
screen: {
h1: [buttonPress],
}
};