https://docs.mendix.com/howto/extensibility/create-native-javascript-action/
go through this, it is document to create javascript action for react native
also try 'react-native' instead of 'react-navigation/native'
Hi Grant,
Mostly it is correct , but try once
const title=document.title
Hi Grant,
the error you are facing is because it is native app, and it won't run on browser so it doesn't understand document
try this import and code below
import { NavigationContext } from 'react-navigation/native';
import { useContext } from 'react';
const navigation = useContext(NavigationContext);
if (navigation && navigation.getCurrentRoute) {
const route = navigation.getCurrentRoute();
if (route && route.name) {
return route.name;
}
}
return 'Unknown Title';
Hi I have managed to get it working now thanks to a combo of changing it to react/native and rereading the documentation.
Thanks
Grant