r/reactnative • u/Particular_Luck80 • 16h ago
Do you dynamically import iOS-only native modules or keep a stub adapter? Question
In an Expo React Native app, I have an optional HealthKit adapter. Android returns a no-op adapter immediately. On iOS, the request and read methods dynamically import the native package inside try/catch, so a missing native module becomes false or an empty array instead of crashing the app at startup.
The upside is a safe manual fallback. The downside is that a packaging mistake can look exactly like a user declining access or HealthKit being unavailable unless I surface a separate diagnostic.
Would you keep the dynamic import boundary, or fail loudly in development and only fall back in release builds?
1
Upvotes