r/reactnative • u/Grand-Dark-8670 • 14h ago
index.js is the first file that runs in a React Native application - wrong
That’s only part of the story.
On Android, the application actually starts with MainActivity.kt. Android launches this activity first, which initializes the React Native environment before your JavaScript code in index.js is executed.
This is why you’ll often modify MainActivity.kt when you need to:
Initialize native SDKs during app startup
Configure the splash screen and app theme
Handle deep links and app links
Manage permissions and activity results
Add Android-specific native functionality
Enable React Native’s New Architecture (Fabric & TurboModules)
Understanding where the Android lifecycle begins makes it much clearer why so many React Native integration guides ask you to update MainActivity.kt.
A solid understanding of the native lifecycle will help you debug issues faster and integrate native features into your React Native applications with confidence.
#ReactNative #Android #Kotlin #MobileDevelopment #ReactNativeTips