Native modules låter React Native (JavaScript) få åtkomst till native plattformskod och funktioner (iOS/Android) som inte är tillgängliga genom JavaScript — brygga till native API:er, SDK:er eller anpassad native funktionalitet. De utökar React Native bortom vad JavaScript ensamt tillhandahåller.
Varför native modules finns
React Native's JavaScript can't directly access every native capability. NATIVE MODULES
bridge JS to native code (Swift/Objective-C on iOS, Kotlin/Java on Android):
→ access native APIs/SDKs not exposed to JS
→ use existing native libraries
→ implement performance-critical or platform-specific functionality in native code
→ The bridge between React Native's JS and the native platform.
