Skip to main content
Version: 1.0.116

All Modules

All the methods like onPress, onLongPress, onStart, onResume, onPause and onEnd in framework has access to moduleParams parameter that has all the available modules.

A cheat sheet for all available modules to quickly start.

ModuleHow to use ?
navigation
const navigation = moduleParams["navigation"]
navigation.navigate("AnotherScreen", { "name": "value" })
read complete details
route
const name = moduleParams["route"].params["name"] 
read complete details
session
const session = moduleParams["session"] 
session.setValue("name", "value")
read complete details
database
const database = moduleParams["database"]
database.setData("books", {
"_id" : "1",
"name" : "Nice book by Nano",
"author" : "Mr. Author"
})
read complete details
toast
const toast = moduleParams["toast"]
toast.show({
type: 'success',
text1: 'Logged In',
text2: 'Loged in Successfully',
position: "bottom"
});
read complete details
deviceInfo
const deviceInfo = moduleParams["deviceInfo"]
console.log(deviceInfo.getDeviceId())

read complete details
alert
const alert = moduleParams["alert"] 

alert.alert('Alert Title', 'My Alert Msg', [
{
text: 'Cancel',
onPress: () => console.log('Cancel Pressed'),
style: 'cancel',
},
{text: 'OK', onPress: () => console.log('OK Pressed')},
])
read complete details
dimensions
const windowHeight = moduleParams["dimensions"].windowHeight
const windowWidth = moduleParams["dimensions"].windowWidth
const screenHeight = moduleParams["dimensions"].screenHeight
const screenWidth = moduleParams["dimensions"].screenWidth

read complete details
linking
const linking = await moduleParams["linking"];
linking.openURL("https://nanoapp.dev");
read complete details
share
try {
const share = await moduleParams["share"]
const result = share.share({
message:
'Nano | Makes mobile app development easier',
});

if (result.action === moduleParams["share"].sharedAction) {
if (result.activityType) {
// shared
} else {
// shared
}
} else if (result.action === moduleParams["share"].dismissedAction) {
// dismissed
} 
} catch (error: any) {
console.log(error.message);
}
read complete details
appearance
const appearance =  moduleParams["appearance"]
const colorScheme = appearance.getColorScheme();
if (colorScheme === 'dark') {
// Use dark color scheme
} 
read complete details
interactionManager
const interactionManager = moduleParams["interactionManager"]
interactionManager.runAfterInteractions(() => {
// ...long-running synchronous task...
});
read complete details
platform
const os =  moduleParams["platform"].OS;
read complete details
pixelRatio
const pixelRatio = moduleParams["pixelRatio"]
const size = pixelRatio.getPixelSizeForLayoutSize(200);

read complete details
layoutAnimation
const layoutAnimation = moduleParams["layoutAnimation"]
layoutAnimation.configureNext(layoutAnimation.Presets.spring);
read complete details
uiManager
const uiManager = moduleParams["uiManager"]
uiManager.setLayoutAnimationEnabledExperimental(true);
read complete details
devSettings
const  devSettings = moduleParams["devSettings"]
devSettings.addMenuItem('Show Secret Dev Screen', () => {

});
read complete details
systrace
const systrace = moduleParams["systrace"]
systrace.setEnabled(true);
read complete details
vibration
const ONE_SECOND_IN_MS = 1000;

const PATTERN = [
1 * ONE_SECOND_IN_MS,
2 * ONE_SECOND_IN_MS,
3 * ONE_SECOND_IN_MS,
];
const vibration = moduleParams["vibration"]
vibration.vibrate(PATTERN)
read complete details