fix(android): replace BaseReactPackage with ReactPackage for RN 0.70-0.73 compatibility - #8
Conversation
…0.73 compatibility BaseReactPackage was introduced in React Native 0.74, causing "Unresolved reference: BaseReactPackage" build error in RN 0.70-0.73. Changed to ReactPackage interface which exists in all React Native versions.
WalkthroughThe ImageCodeScannerPackage is refactored from extending BaseReactPackage to directly implementing the ReactPackage interface. The module provisioning mechanism shifts from per-name module lookup via getModule to bulk provision via createNativeModules, with createViewManagers added to return an empty list. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🔇 Additional comments (4)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Description
Fixes build failure in React Native 0.70-0.73 caused by
BaseReactPackagewhich doesn't exist in these versions.Problem
BaseReactPackagewas introduced in React Native 0.74. Using it causes build errors in RN 0.70-0.73:Unresolved reference: BaseReactPackage
Solution
Replace
BaseReactPackagewith directReactPackageinterface implementation, which exists in all React Native versions.Changes
ImageCodeScannerPackagefrom extendingBaseReactPackageto implementingReactPackagegetModule()andgetReactModuleInfoProvider()withcreateNativeModules()andcreateViewManagers()Summary by CodeRabbit