Hi Thomas,
You cannot directly add a react-native code to your native application. You can always create a custom widget that when placed in a page will execute the code in it. This will help https://docs.mendix.com/howto/extensibility/build-native-widget .
If you are trying to execute only during an action you can use this https://docs.mendix.com/howto/extensibility/create-native-javascript-action#custom-developer-app .